iOS remote push a variety of pits, ah roar roar ~apns

Source: Internet
Author: User
Tags key string notification center ssl certificate

SOURCE Link: http://blog.csdn.net/showhilllee/article/details/8631734?reload

Remote Push write The most detailed is this, in view of my repeated four or five times, I do not even the word with the picture of the turn, no longer I ╭ (╯^╰) ╮

Main writing various pits:

1. Certificate certificates

The development or release of the IPA must have applied for a certificate, but it was really a daze, holding the company account a variety of halo, inside a bunch of ID, with * without *, a variety of certificates do not know which can be used. Anyway is a variety of test, can use the hurriedly use of again.

Here, first of all, basically just get the account, on the application of a variety of certificates have no concept of children, can be inside various operations, research naming rules and so on, convenient to take the name.

But, remember: once you understand, be sure to put out which mess, all kinds of test certificates are deleted, clear out. Certificate do not money Ah, pro, casually delete yo, otherwise, the certificate and CSR does not match, all hundred ride. To know that the CSR is generated by their own computers, one is not well-preserved, mismatched, there are certificates also hundred. If these certificates are released, the product will be more dizzy.

So, after figuring out, before the official release, the mess of the certificate are deleted. Ensure that the certificate in the Developer Center is clean and tidy.

Generally we use two kinds of certificates: 1.development Development Certificate, 2.production release certificate. It is easy to understand the required certificates for debug and release versions.

These two types of certificates can only be applied for up to two copies. So the resources are precious. After the application is completed, please take care of the certificate application document created in the CSR "Keychain", and the CER file that starts with the generated ios_. In particular, the previous CSR file, because the certificate is not available to re-download in the developer Center.

Install the certificate, double-click the CER file on the line. However, before installing, remove all the messy certificates from your previous test fashions into the keychain. Keep it fresh. Or you don't want to look at the details in the back.

Well, I recommend applying for both development certificates and publishing certificates so that they correspond to the same CSR and are easy to manage and maintain later. Double-click to install two CER certificates into the keychain separately. There will be a small triangle in front of the certificate, and the following is your CSR key. If there is no such a small triangle, stating that there is no matching CSR file, basically this certificate is not very useful, can be deleted, re-apply for installation, or find a CSR file on another computer, *.certsigningrequest. Copy it back.

2.APP ID

This delete installs N times, deeply realizes his meaning ah. t_t

Previously did not know AppID Bundleid is what to do with, all with wild ID, is * The general development, this is enough. However, if you want to do APNS remote push notification, you must have a unique Bundleid string. And this string should be consistent with the app's Bundleid.

Here, I fell into a hole. I applied for the application of the same ID, because some reasons can not be pushed, so I create a new test app, and then the test program Bundleid changed to be used for the release of this formal Bundleid, and then push OK, I that happy ah.

Then switch back to the app I want to publish, run, push, receive. Then I found out in the notification center that the name of the app was actually test!!!!!. I can't change it,!!!!!!!.

Because this is a security mechanism for APNs, is to prevent people from forging Bundleid, intercept push notifications. So I really want to use the app received, but the title is the registration of the successful app name. And my registration was test!. Hang Daddy.

Fortunately, APNs's registration mechanism is for a single device, each of which corresponds to only one drive token. So, the other test machine has not come to my pollution, ⊙﹏⊙ B.

I tried to delete the app ID, re-build one, bundle ID must be unique, so the previous one must be deleted, but deleted after rebuilding one, there is no change. I just remembered. APNs's registration is for a device. So the device restored, and then reinstall, push, receive push, and then push the notification in normal.

App ID request push of two SSL certificate, this is nothing to say, remember the CSR file with the above said certificates inside the consistency is OK. Then double-click the CER file to install it in the keychain.

3.provisioning Profiles

Configuration file for Xcode. Before that, it must have been tested and installed a lot of provisioning profiles. Open Build Setting->code signing, click on Provisong profiles, you can see the current installation up. Bo Master my Xcode inside that called a mess ah, the previous personal account, the company account, and other projects to try to use the .... Take advantage of this opportunity to erase all ...

Delete is in the xcode->preferences->accounts inside, select Account, the bottom right corner has a view details, point open, inside there is currently installed provisioning profiles. can be cleaned up.

Clean up, you can click Install the latest generated configuration file, now, then look at Xcode build Setting->code signing, very refreshing, there are wood.

4. Generate CK.PEM

Export the. p12 file, this file must be clicked on the key string that I said above certificates. After installing the certificate, the key in the triangle below right-click Export. I used to figure simple, directly find the key, export, and then I found that only a single export of more than 1k, the certificate this export has more than 3k. Why am I so easy to make two ~ ~ ~ (>_<) ~ ~ ~ ~ ~

The CHATCERT.PEM,CHATKEY.PEM is then generated, and both add up to generate CK.PEM. Password best and P12 consistent, good management ah.

5.php pushme.php

I was in the source address of the blogger's this server file pit dead. Because he is talking about the test environment, but PHP files are used in the official address of the APNs, I also glasses with a pit, see a few times did not find. So the client is always not receiving. Think my certificate where the wrong, and constantly delete ah build ah, change Ah, change app test ah ... Toss two days ...

6. Push Network-based

Remote push is not received when the device is not connected to the network, so, do need to see if there is no suitable place. And the push is also very unreliable, and sometimes will drop push. Well, uh ...

Let's summarize these at the moment. Found not in summary push, is completely in the summary of various certificate applications and configuration ...

In short, did not make out before, hear the mobile phone app to push messages, feeling is in my ruthless ridicule. Now made, ding-dong sound really sweet ah, I push me push me hard push, ah haha haha ~ no wearies (⊙o⊙) Oh ~ ~ ~

iOS remote push a variety of pits, ah roar roar ~apns

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.