Reference required for iOS10 upgrade compatibility and required for ios10 upgrade compatibility

Source: Internet
Author: User

Reference required for iOS10 upgrade compatibility and required for ios10 upgrade compatibility

Recently submitted for review failed, and then run crash on iOS10. Then we need to deal with the crash issue. We looked for it at night and collected it. For later use.

Refer:

Http://blog.csdn.net/gbking/article/details/52587149

Http://www.cnblogs.com/xiaoc1314/p/5882403.html

Http://www.jianshu.com/p/61b73ac8662a

Http://www.2cto.com/kf/201609/547127.html

Http://www.jianshu.com/p/90d5323cf510

1. Push

After xcode is upgraded to 8, many people cannot receive push messages. A friend who failed to get the token for an hour could not find the reason. just look .... I found that I could receive notifications even if I didn't open xcode. but to 8 (the push can only be received after it is enabled ). it doesn't seem to work.

The differences between ios10 and previous push are as follows:

  • Notifications before iOS 9

     

    1. When calling methods, some methods are difficult to distinguish and are easy to write wrong methods, which makes developers sometimes very worried.

    2. The paths for the application to capture notifications at runtime and non-runtime are inconsistent.

    3. Remote notifications cannot be directly displayed when the application is on the frontend. Further Processing is required.

    4. the notifications that have been sent cannot be updated, and the content cannot be changed when it is sent. In addition, only the simple text display method is available, and the scalability is not very good at all.

  • Notifications starting with iOS 10

    1. All related notifications are unified into the userconfigurations. framework.

    2. Added undo, update, and notification content that can be modified midway through.

    3. Notifications are no longer in simple text. You can add videos, images, and display custom notifications.

    4. Compared with previous notifications, iOS 10 is easier to use and manage, and has been optimized on a large scale. This is a good thing for developers.

    5. Since iOS 10, the permission issue has been optimized, so it is easy to apply for permissions (local and remote notifications are integrated in a method ).

 

 

2. Font adaptation

The lab Font before ios 9 can be fully displayed, but ios10 finds that the font display is incomplete. It must be adapted. The app will change with the font size of the mobile phone system.

The simple and crude method is to prevent him from changing with the font of the mobile phone system.

Label. adjustsFontForContentSizeCategory = YES;

 

3. Run xcode 8 to print a bunch of useless things. The solution is to set OS _ACTIVITY_MODE: disable, for example:

 

 

4. What is the comment shortcut for xcode8? command +/cannot work.

Solution:

Because Apple solves xcode ghost. Block the plug-in. Solution
Run the following command: sudo/usr/libexec/xpccachectl.
Then it takes effect after the computer is restarted.

5. Color problem, iOS 10 Apple officially recommends that we use sRGB because it has better performance and richer colors.

The following two APIs are added to the UIColor class:

+ (UIColor *) colorWithDisplayP3Red :( CGFloat) displayP3Red green :( CGFloat) green blue :( CGFloat) blue alpha :( CGFloat) alpha NS_AVAILABLE_IOS (10_0);-(UIColor *) gradient :( CGFloat) displayP3Red green :( CGFloat) green blue :( CGFloat) blue alpha :( CGFloat) alpha NS_AVAILABLE_IOS (10_0 );

 

 

6. Determine version Problems

[[UIDevice currentDevice] systemVersion] is recommended.

Swift

if #available(iOS 10.0, *) {

// What about iOS 10.0?

Print ("iOS 10.0 ");

} Else

{

}

;

 

7. https Problems

In iOS 9, non-HTTS networks are disabled by default. Of course, we can also set NSAllowsArbitraryLoads to YES to disable ATS. However, since November 10, January 1, 2017, Apple does not allow us to skip ATS using this method. That is to say, we are forced to use HTTPS. If this is not the case, submitting the App may be rejected. However, we can use NSExceptionDomains to enable HTTP for specific domain names and easily pass the review.

 

8. Privacy permission

Since iOS 10, privacy permissions are more stringent. If you do not set them, the system will crash directly. Now, many crash problems occur. The general solution is in info. add the corresponding Key-Value to the plist file.

<! -- Album --> <key> NSPhotoLibraryUsageDescription </key> <string> the App requires your consent to access the album </string> <! -- Camera --> <key> NSCameraUsageDescription </key> <string> the App requires your consent to access the camera </string> <! -- Microphone --> <key> NSMicrophoneUsageDescription </key> <string> the App requires your consent to access the microphone </string> <! -- Location --> <key> NSLocationUsageDescription </key> <string> the App must have your consent to access the location </string> <! -- Access location during use --> <key> NSLocationWhenInUseUsageDescription </key> <string> the App requires your consent to access location during use </string> <! -- Always access location --> <key> NSLocationAlwaysUsageDescription </key> <string> the App must have your consent before it can always access the location </string> <! -- Calendar --> <key> NSCalendarsUsageDescription </key> <string> the App requires your consent to access the calendar </string> <! -- Reminder --> <key> NSRemindersUsageDescription </key> <string> the App requires your consent to access the reminder </string> <! -- Sports and fitness --> <key> NSMotionUsageDescription </key> <string> the App requires your consent to access sports and fitness </string> <! -- Health update --> <key> NSHealthUpdateUsageDescription </key> <string> the App requires your consent to access health update </string> <! -- Health sharing --> <key> nshealthpolicusagedescription </key> <string> the App requires your consent to access health sharing </string> <! -- Bluetooth --> <key> nsbluw.thperipheralusagedescription </key> <string> the App requires your consent to access Bluetooth </string> <! -- Media database --> <key> NSAppleMusicUsageDescription </key> <string> the App requires your consent to access the media database. </string>

Or

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.