結果 : code for both ios and android