Some "pitfalls" and "solutions" for iOS game development and submission

Some "pitfalls" and "solutions" for iOS game development and submission

[[156840]]

In view of the fact that I always encounter some pitfalls in the process of iOS game development and submission for review, in order to avoid falling into the same pit twice, I came up with the idea of ​​recording them. After a few months, I have accumulated ten pitfalls, which I will share now and will continue to update in the future.

I have put the markdown source file of this article on Github. Please submit your "pitfalls" and "solutions" through Fork and P&R to help me improve it. You can also keep an eye on these "pitfalls" by following this project.

Local save files are lost on iOS devices

Description: On Apple devices, when the system prompts that the storage space is full, it is found that the local archive is lost.

Reason: By default, local archives are placed under /Library/Caches. According to Apple's official description, any files placed in the /Library/Caches directory will be cleared by the system when the system pops up a warning that the storage space is full.

Solution: Place all data and hot update files in the /Library/Application Support directory. All files in this directory will not be removed when the space is full. In addition, this also avoids the risk of being rejected by Apple during the review if placed in the Documents directory.

Apple Watch version submission failed

Description: ***Submitting a version with Apple Watch to the AppStore failed, causing the submission to be unable to continue.

Reason: The PNG image of the Apple Watch version of AppIcon has an alpha channel, so it was rejected.

Solution: Remove the alpha channel of all AppIcon PNG images for the Apple Watch version.

Apple Watch version review rejected

Description: After the Apple Watch version was submitted, it was rejected during the Apple review stage.

Reason: In this app on Apple Watch on iPhone, our game name is displayed as codename: xxx ios.

Solution: In the Info.plist of the Watchkit Extension, the Bundle name is the default PRODUCT_ID, which is our codename. Just change the Bundle name to the game name. It should be noted that the Bundle name is not the same as the Bundle display name. The former is used for some display names in the system settings, while the latter is used for the name display of the App in the Launcher.

In-game purchases (IAP) have been cracked

Description: According to the background Counter report, we are sure that our stand-alone game in-app purchases have been cracked.

Reason: A highly likely reason is that we store the order number in a local cache file. Every time we go to the Apple server to ask whether the order is successful, we first check this cache file to see if there is the same order number. If it is found, it means that the order is repeated. However, once the player deletes this cache file, he can repeatedly use an order number that has been successfully paid to repeatedly swipe.

Solution: The most reliable solution is to store the order number on the server and then encrypt the communication with the server. We adopted a method that does not use the server: when the *** recharge is successful, add a mark (minus sign) to the gold coin cache file, and then query the order cache file first when querying the order cache file. If the mark is found, it means that the recharge has been made before, and the order cache file should have content. If the order cache file content is empty, or no meaningful order number is found, it means that the player cheated, and the recharged gold coins will not be added this time (cheating penalty). Since the cache file has been encrypted by AES in advance, it is difficult for players to find the mark.

Apple Watch OS2 runtime cannot find images

Description: The Apple Watch OS1 version has no code changes, but when running it, it prompts that the image cannot be found.

Reason: The images in Images.xcassets under the WatchKit App only set 1x images, and 2x and 3x images are not set.

Solution: Set up 2x and 3x images.

When uploading a binary using Application Loader, an error message appears: ERROR ITMS-90168: "The binary you uploaded was invalid."

Description: Same as title.

Reason: Unknown, may be related to upgrading Xcode to 7.

Solution: Open the command line and enter the following code:

  1. cd ~/.itmstransporter
  2. rm update_check*
  3. mv softwaresupport softwaresupport.bak
  4. cd UploadTokens
  5. rm *.token

Devices below iOS 9 do not support ReplayKit, so the game cannot be launched

Description: Same as title.

Reason: ReplayKit is a framework introduced in iOS9, so it cannot be used on devices below iOS9.

Solution: Open Xcode, search for ReplayKit under the target's Build Phases, and change the Status of ReplayKit.framework from Require to Optional. Similarly, if you encounter a situation where an earlier version of iOS does not support it, such as iOS 8 and below that does not support CloudKit, you can change the Status of the framework from Require to Optional.

Xcode 7 and above do not support http requests by default

Description: Application Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file..

Reason: Xcode 7 and above only support https requests by default for security reasons.

Solution: Open Xcode, edit Info.plist or select the Info column of the target, add a new field App Transport Security Settings, and set the value of its internal key Allow Arbitrary Loads to YES.

Xcode 7 ERROR ITMS-90474: “Bundle Invalid…”

Description: An error message was reported when submitting a binary file: ERROR ITMS-90474: "Bundle Invalid. iPad Multitasking support requires there orientations: 'UIInterfaceOrientationPortrait,UIIinterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 'UIInterfaceOrientationPortrait' in bundle."

Reason: Since iOS 9 introduced multitasking, iOS apps must set whether they require full-screen display.

Solution: Open Xcode, select the target, and in the General column, check Requires full screen.

Xcode 7 ERROR UnityAds.Bundle ITMS-90535 Unexpected CFBundleExecutable Key

Description: An error message appears when submitting a binary file: ERROR UnityAds.Bundle ITMS-90535 Unexpected CFBundleExecutable Key.

Reason: The old version of UnityAds.Bundle contains the CFBundleExecutable field, which Apple will verify after Xcode7.

Solution: Search for UnityAds in Xcode, find Info.plist in UnityAds.Bundle, and delete its CFBundleExecutable field. The name of this field displayed in Xcode is: Executable file.

<<:  Pattern matching in Swift

>>:  The capital winter is still here, why is now still the best time to start a business?

Recommend

3 practical live streaming sales techniques!

Some people say that sales is a script, and all y...

User operation: How to stimulate users’ desire to act?

Why do users want to use/participate/take action ...

How do knowledge payment platforms increase user growth? 5 routines!

The middle class’s “knowledge anxiety” has led to...

What should Baidu Wenku do? What are the tips for uploading to Baidu Wenku?

With the continuous development of the Internet, ...

The Essence of Gravitation

The concept of gravity Gravity is the interaction...

Do people with photographic memories really exist?

© Genetic Literacy Project Leviathan Press: The w...