Problems in upgrading xcode8 compatible with IOS 10 and solutions to some adaptation problems

1 push

After Xcode is upgraded to 8, many people can't receive push I couldn't get the token. My friend didn't find the reason for it for an hour Just look at the picture below I found Xcode that he could receive the notice even if I didn't open it But at 8 (you must open it to receive the push) It seems that we can't. let's take our seats according to the number

Here is the difference between IOS 10 and previous push

• previous notifications for IOS 9

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

2. The path for the application to capture notifications at runtime and non runtime is not consistent.

3. When the application is in the foreground, the remote notification cannot be displayed directly, and further processing is needed.

4. The notice that has been sent cannot be updated, and the content cannot be changed when it is sent. There is only a simple text display mode, and the scalability is not very good at all.

• notification of IOS 10 start

1. All relevant notifications are unified to usernotifications Framework.

2. The contents of the notice of revocation, update and modification in the middle are added.

3. The notice is no longer a simple text. You can add videos and pictures, customize the display of the notice, etc.

4. IOS 10 is easier to use and manage than the previous notification, and has been optimized on a large scale, which is a good thing for developers.

5. IOS 10 began to optimize the permission problem, and it is relatively simple to apply for permission (local and remote notification are integrated in one method).

2 font adaptation

The lab font before IOS 9 can be displayed in full, but the font is not displayed in full in IOS 10 It has to fit The app will change according to the font size of the mobile phone system

The simple and crude way is not to let him change with the font change of the mobile phone system

label. adjustsFontForContentSizeCategory = YES;

terms of settlement:

Because Apple solves Xcode ghost. Block the plug-in. resolvent

Command run: sudo / usr / libexec / xpccachectl

Then the computer must be restarted before it takes effect

5 color problem, IOS 10 Apple official suggested that we use sRGB because it has better performance and richer colors.

Two APIs are added to the uicolor class as follows:

6. Judge the version problem

[[uidevice currentdevice] systemversion] is recommended

For swift

7 problems with HTTPS

The default non HTTs network in IOS 9 is prohibited. Of course, we can also set nsallowsarbitraryloads to yes to disable ATS. However, IOS 10 from January 1, 2017, apple does not allow us to skip ATS through this method, that is, it forces us to use HTTPS. If not, submitting the app may be rejected. However, we can use nsexceptiondomains to open HTTP for specific domain names, which can easily pass the audit.

8 privacy rights

IOS 10 began to be more strict with privacy permissions. If you don't set it, you will directly crash. Now many people encounter crash problems. The general solution is info Just add the corresponding key value to the plist file.

The above is the problems and solutions of compatible IOS 10 upgrade xcode8 introduced by Xiaobian, as well as some adaptations. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>