菜鸟教程小白 发表于 2022-12-11 17:41:48

ios - iMessage 游戏 - 发送隐藏值


                                            <p><p>我关注 <a href="https://code.tutsplus.com/tutorials/create-an-imessage-app-in-ios-10--cms-26870" rel="noreferrer noopener nofollow">this tutorial</a>学习 iMessage 应用程序。<br/>一切似乎都很好。<br/><br/>但是,我想开发一个类似 <code>BattleShip</code> 类型的游戏。<br/>这意味着我需要发送对其他玩家隐藏的值。 <br/><br/>我该怎么做?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您可以将隐藏参数作为 <a href="https://developer.apple.com/reference/messages/msmessage/1649739-url" rel="noreferrer noopener nofollow">URL</a> 的一部分,比如</p>

<pre><code>message.url = URL(string: &#34;http://battleship.example.com/?state=AAAAAA==&#34;)!
</code></pre>

<p>请注意,URL 的长度不能超过 5000 个字符(即在 base-64 之后最多大约 3.5 KiB 的数据。)</p>

<p>您可能想查看 <a href="https://www.shinobicontrols.com/blog/ios-10-day-by-day-day-1-messages" rel="noreferrer noopener nofollow">https://www.shinobicontrols.com/blog/ios-10-day-by-day-day-1-messages</a> 上的教程.</p>

<p>为防止作弊者轻易修改 URL 参数,您可能需要对 URL 参数进行加密和/或签名。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iMessage 游戏 - 发送隐藏值,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/39803713/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/39803713/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iMessage 游戏 - 发送隐藏值