To add APN function to iShare, I try to find make a demo on Mac OS 10.10. Follow thoes listed steps, you can test your program
Objective-C post program or PHP.
这是一份基本版的 Markdown 语法清单
#Recursively can handle many kinds of question.
#Things about APN
Follow Material For Apple push notification can test your app with Development SSL Certificate easily. But when I move to Production SSL Certificate , I spand over 10 hour to figure out some problem. So I write the blog to help people who meetting the same problem like me.
###Use Development SSL Certificate
- [x] iPhone developer certification
- [x] apple development IOS Push Services
###Use Production SSL Certification
- [x] iPhone Distribution certificaion
- [x] Apple Production IOS Push Services
- [x] apple store provisioning profile
Development SSL Certification and Production SSL Certification can exist at same time. But your app just can receive notification from one Certification.
deviceToken A token that identifies the device to APS. The token is an opaque data type because that is the form that the provider needs to submit to the APS servers when it sends a notification to a device. The APS servers require a binary format for performance reasons. Note that the device token is different from the uniqueIdentifier property of UIDevice because, for security and privacy reasons, it must change when the device is wiped.
- DeviceToken might change with time
- DeviceToken might different in different app after iOS7
- DeiceToken is different between Developer certification and Distribution certification
- When you move to production SSL certification, remember change your code signing identity and provisioning in xcode
you need modify Build Settings->Code signing
Debug&Any iOS SDK should be iOS Developer
Release&Any iOS SDK should be iPhone Distribution XXXXX
Provisioning Profile should be Automatic or your apple store Provisioning profile
rebuild your app with new Xcode code signing. You will get a new deviceToken different from deviceToken when you use Developer SSL certification.
Test your app with Cocoa-APNS-Test
print 'hello world'