iOS Push SDK
Wisdom Tooth Push SDK, if you have already integrated Umeng Push, there is no need to use this SDK. You can directly focus on the 3. Bind Alias section. Binding an alias can still use Umeng’s method to bind directly. Relevant Restrictions and Precautions- Enable network request permission
- The App enables the push notification function
- Integrate the Umeng Push SDK
Integration Method
Manual Integration
Download link: iOS_Push_SDK Unzip [iOS_SDK], and add the necessary files SobotPush.framework and the Umeng push SDK integration package to your project. The ZhiChi push SDK is based on the implementation of the Umeng SDK and relies on some system frameworks. When developing the app, these frameworks need to be added to the project. First, the developer clicks the project name on the right side of the project, then selects TARGETS -> Build Phases -> Link Binary With Libraries in sequence on the right side of the project name. After expanding Link Binary With Libraries, click the ”+” below to add the following dependencies:- CoreAudio.framework
- libz.tbd
- SystemConfiguration.framework
- libsqlite3.tbd
- UserNotifications.framework
- CoreTelephony.framework
File Description
The SDK includes SobotPush.framework, SobotDemo, and Doc-related documentation.Quick Start
Step 1 Initialization
Initialize Umeng Push The main calling code is as follows: Interface:
Example code:
Step 2 Permission Settings
Permissions to be addedStep 3 Register Push Notification
1. Register for remote push notifications
Register for remote push notifications at- Add push notification registration code in the
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptionsmethod Example code
2. Register the deviceToken of this device with Umeng
Register the deviceToken of this device with Umeng to facilitate sending Push messages. Example3. Bind Alias
Bind an alias to a device (including account and platform type), and unbind the device that this alias was previously bound to. Note: The prerequisite for adding an Alias is that the device_token has been successfully obtained; otherwise, it will fail (kUMessageErrorDependsErr). After logging in, users can set aliases in three ways: [You can directly use the Umeng API to bind aliases]- Connection ID partnerId 2.Email email 3.Phone tel Select one of the methods to set an alias. Call it after the app logs in successfully and registers the device’s deviceToken with Umeng. Example
Function Description
Click Push Message Event
Click the push notification to go to the specified page in the app or open the link.iOS Rich Text Push Notifications
If you want to add images to push notifications, you can achieve this by adding a Notification Service Extension. First, we create a Notification Service Extension. The specific steps are as follows: File——>New——>Target——->Notification Service Extension——->Name the created Notification Service Extension Copy the following code into the NotificationService.m file, or you can write related code by yourself.- Self.bestAttemptContent.title = [NSString stringWithFormat:@”%@ [modified]”, self.bestAttemptContent.title]; can be used to test if the project has called the notification service.
- The image size cannot exceed 10M, and the content link must be https.
-
Add network permissions to the info.plist file in the Notification Service Extension project.
NSAppTransportSecurity - When testing push notifications, select NotificationService Target for packaging.
- Test push needs to be packaged in adHoc format for verification.