There are a lot of pushes, like a push, a friend league, a melting cloud and aurora Borealis and so on. Here's how to use the Aurora push.
The main content is to summarize the official documents in detail and integrate them into the project in one step, and you can also go directly to the official documents.
Aurora Push SDK Download
Open the Official document directly to download the latest SDK
Aurora Web Create app and upload certificate
First, the production of push certificates and descriptive narrative documents: need to pay attention to the production of two certificates, one is a test certificate, one is to publish the certificate, detailed look at the Official document: Click to view Certificate production
See the IOS Certificate Setup Guide No, no, no, it's too much crap.
Second, in the Aurora push the official website to register your app.
Bundle ID to be the same as your project has been, assuming that the test to choose the development environment. On-line and then switch on to be able to, development environment and production environment certificate don't confuse it. It's a p12 file, and there's password.
Project configuration Issues
1. Directly drag the Lib directory in the SDK to the project, which is mainly two files, a static installation package and a. h file. There is a sound file in the demo to join.
2. Join the necessary framework
Cfnetwork.framework
Corefoundation.framework
Coretelephony.framework
Systemconfiguration.framework
Coregraphics.framework
Foundation.framework
Uikit.framework
Security.framework
Adsupport.framework (get IDFA required)
Xcode7 need is libz.tbd;xcode7 The following version number is Libz.dylib
3, assuming that the SDK is 2.1.0, directly compiled, assuming an error, there will be a bitcode errors, directly to the build Settings close bitcode option;
If there is an error, see if it is because the static library of. A is not found. Drag the static library address to the past.
4, assuming that the old version number, SDK1.8.8 Create and configure the Pushconfig.plist file,
Assume that the latest SDK has been skipped directly. Just ignore this one and you can.
5. If you use Xcode7, you need to manually add the following key and value in the plist of the app project to support HTTP transmission:
1. Add nsapptransportsecurity type dictionary to Info.plist.
2. Under Nsapptransportsecurity, add the Nsallowsarbitraryloads type Boolean with the value set to Yes
Note: Not a unit test info.plist
6. Open Push Settings
7. Open Xxx-info.plist Bundle identifier to fill in the bundle ID uploaded to the jpush console:
Project Code
You can also view the detailed demo directly in the SDK of the first step.
Import header file in Appdelegate.h
#import <AdSupport/AdSupport.h>#import "JPUSHService.h"
- (BOOL)Application:(uiapplication*) Applicationdidfinishlaunchingwithoptions:(nsdictionary*) Launchoptions {NSString*advertisingid = [[[AsidentifiermanagerSharedmanager] Advertisingidentifier]uuidstring];if([[UideviceCurrentdevice].systemversion Floatvalue] >=8.0) { [Jpushservice registerforremotenotificationtypes:(Uiusernotificationtypebadge|Uiusernotificationtypesound|Uiusernotificationtypealert)Categories:Nil]; }Else{ [Jpushservice registerforremotenotificationtypes:(Uiremotenotificationtypebadge|Uiremotenotificationtypesound|Uiremotenotificationtypealert)Categories:Nil]; } [Jpushservice setupwithoption:LaunchoptionsAppKey:Jpushappkey Channel:Channelapsforproduction:IsproductionAdvertisingidentifier:Advertisingid];}
Required parameters in the Setupwithoption method
Appkey: Register the Appkey, the site to find it
Channel: Write a random string. It's okay.
Advertisingidentifier: Advertising identifier, (Apple is obsolete, this fellow, eh)
Apsforproduction:bool value, whether it is a development environment or a test environment
Next is a couple of callback function settings to be able to
-(void)Applicationdidenterbackground:(uiapplication*) application {[[uiapplicationSharedapplication]Setapplicationiconbadgenumber:0];} -(void)Applicationwillenterforeground:(uiapplication*) application {[ApplicationSetapplicationiconbadgenumber:0]; [Application cancelalllocalnotifications]; }-(void)Application:(uiapplication*) ApplicationDidregisterforremotenotificationswithdevicetoken:(NSData*) devicetoken{[Jpushservice Registerdevicetoken:Devicetoken];NSLog(@"%@", [NSString stringWithFormat:@"Device Token:%@", Devicetoken]);} -(void)Application:(uiapplication*) ApplicationDidfailtoregisterforremotenotificationswitherror:(Nserror*) Error {NSLog(@"did Fail to Register for Remote notifications with Error:%@", error);} -(void)Application:(uiapplication*) Applicationdidreceiveremotenotification:(nsdictionary*) UserInfoFetchcompletionhandler:(void (^) (Uibackgroundfetchresult)) completionhandler{NSLog(@"8.0 Receive notification:%@",[ Self Logdic:UserInfo]); [Jpushservice handleremotenotification:UserInfo]; Completionhandler (Uibackgroundfetchresultnewdata);}
Detailed API Reference detailed version number SDK. My SDK is 2.1.5, the newest Oh!
The Completionhandlez function is mainly 2:
1, and according to the Uibackgroundfetchresult parameters passed to record whether the new data is available
2, when the processing code is finished. The app's interface thumbnail will be updated on its own initiative
Test Push
Well, you are now running the project on the real machine, then you can go to the Aurora Station to test if your push is successful (app can be notified in the background or lock screen)
Summary of Issues
If the console doesn't print out your message, it means you have a problem.
Don't worry. Look at the official question summary, anyway, you follow the above, ensure that no problem, oh, "" "" "Problem summary
Project Combat: iOS Aurora Push Integration (30 minutes to fix)