Aurora push and Baidu is more simple, but there are very novice for the integration of aurora push configuration certificate more confused, there is no too small white tutorial, so I wrote this. This tutorial integrates only basic functionality.

  1. Generate CSR file open keystring, click keystring access. Select Certificate Assistant, and then select Obtain certificates from certificate Authorities.

    Select after obtaining a certificate from a certificate authority

    The CSR file can be saved to the disk by clicking continue. The CSR file can be saved to the disk.

    After the preceding steps are performed, the CSR file is successfully generated.

  2. Go to the Apple Developer website, log in to the developer Account, click on Account, and go to the following page.

    Click on the red area to go to the next page.

    Click the App IDs on the left to create the App Id.

    Click the + sign to enter

    Where the Bundle ID should be the Bundle ID of the project you want to push to the integrated Aurora. Scroll down the page and select Push Notifications

    Click continue.

    It can be seen that push in the development environment and push in the production environment of the APP ID both need to configure certificates.

  3. Configure certificates. Click All under Ceterfpioneered on the left to go to the following page:

    Above is the test certificate, below is the production certificate. Both need to be configured. Configure the certificate for the development environment and select Apple Push Notification Services SSL. The following page is displayed

    Select the App ID you just created and click Continue

    Select the CSR file saved to disk in the first step. Finally, generate the certificate under the development environment.

    Click Download to download the certificate to your computer, and double-click to run it. Perform the same steps to configure the certificate for the production environment. Download the certificate to your computer and double-click to run it.

  4. Bind the real machine click All under left Devices to see the following page

    Click the plus sign to add a new phone. If you already have one, you don’t need to add it. Here’s how to add a new phone.

    Name is the name of a mobile phone and can be filled in at will. UDID is the unique identifier of each mobile phone. How to obtain the UDID? Connect the mobile phone to the computer, open the Xcode machine and run the program, then click the window in the upper right of Xcode and select Devices.

    You can see the xcode device. If you select the phone, you can see the UDID on the right

    Then return to the page and fill in Name and UDID to bind the corresponding real machine.

  5. To generate an Xcode profile click All under Provisioning Profiles on the left

    Click the + sign in the upper right corner to generate the configuration file.

    Select the first iOS App Development and click Continue. If this appears, it will tell you that you did not create a real test certificate. You need to create a real test certificate

    Click on the create XXXX

    Again, select the first iOS App Development and click Continue to work your way down, similar to creating a certificate in your Development environment. Upload the CSR file finally, then click Download and double click Install. After the installation is successful, continue to generate the Xcode configuration file, repeat the steps above, and then you will be given the option

    Clicking Continue will let you select the device

    Finally, check your App ID and see that the Push notifications of AppID are enabled, indicating that your credentials are configured successfully.

  6. Export Push certificate and generate p12 file. Open the keystring, click login on the left, then there is the column of my certificate in the lower left, click my certificate, you can see two files, as shown in the picture,Apple Development XXXX is the Push certificate in the test environment,Apple Push XXXX is the certificate in the production environment.

    Right-click the two files and choose Export

  7. Upload to aurora push, log in to aurora push official website, log in your account. Create a project

    Upload two. P12 files

  8. Download the SDK of iOS project pushed by Aurora, decompress the SDK package after downloading, and select “Add Files to ‘Your project name’…” in XCode. Add the decompressed lib subfolders (including jpushService. h and jpush-ios-x.x.x.a) to your project directory. Add the necessary frames:

CFNetwork.framework CoreFoundation.framework CoreTelephony.framework SystemConfiguration.framework Coregraphics.framework foundation.framework UIKit.framework Security. Framework Xcode7 requires libz.tbd; Libz.dylib adsupport. framework (required to obtain IDFA; Do not add IDFA if you do not use IDFA)Copy the code

Configure HTTP:

#import "JPUSHService.h"
#import <AdSupport/AdSupport.h>
Copy the code

Then add the following code

-(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  self.window.backgroundColor = [UIColor whiteColor];
  [self.window makeKeyAndVisible];

  NSString *advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
  //Required
  if ([[UIDevice currentDevice].systemVersion floatThe Value] > = 8.0) {/ / you can add custom categories [JPUSHService registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil]; }else{/ / categories must be nil [JPUSHService registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert) categories:nil]; } / / Required. / / if you want to continue to use pushConfig file statement appKey configuration such as the content, please still use [JPUSHService setupWithOption: launchOptions] way to initialize. //CHANNEL Specifies the download CHANNEL of the application package. You can define the specific value for the convenience of statistics by CHANNEL, for example, App Store. / / APP_KEY fill in/applications to create management Portal (https://www.jpush.cn/apps/new) automatically generated after AppKey values. Ensure that the AppKey configured in the application is consistent with the AppKey generated after the application is created in Step 1 on the Portal. // Added in version aps_for_production1.3.1, which identifies the APNs certificate environment used by the current application. //0 (default value) indicates that a development certificate is used. 1 indicates that a production certificate is used to publish applications. // Note: The value of this field must be consistent with the Code Signing configured for Build Settings. [JPUSHService setupWithOption:launchOptions appKey:appKey channel:channel apsForProduction:isProduction advertisingIdentifier:advertisingId];return YES;
}
Copy the code

Add another registration code:

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { / / / Required - registered DeviceToken [JPUSHService registerDeviceToken: DeviceToken]; }Copy the code
  1. Click aurora push to select the item you add, and click push to enter the following page

    Run the program again on the mobile phone, let the program enter the background, and then input the content you want to push on the web page, select the platform, click push, mobile phone can receive the push message!