This document describes how to quickly integrate TPNS into your iOS application. You can use the local tool to configure TPNS for your application in just a few clicks with no code integration required.
Upload the push certificate on the Configuration Management page. You can get the push certificate as instructed in Acquisition of Push Certificate.
After completing the above steps, click "Quick Integration" to download the quick integration tool.
Decompress the package and double-click TPNS Smart Tool.
The message "Unable to open TPNS Smart Tool" will be displayed.
Go to System Preferences > Security & Privacy > General and click Open Anyway.
Enter the system password as prompted to confirm the operation and click Open Anyway again after the confirmation. The Open button will be displayed. Then, click it.
After starting the quick integration tool, go to the homepage and click Start Integration.
Enter the configuration page and configure the following 6 items as detailed below.
Log in to the TPNS console.
On the "Product Management" page, find the product for which to configure the push capability and select configuration management for iOS or macOS.
Enter the product configuration management details page, copy
AccessKey, and paste them into the corresponding input boxes in the quick integration tool.
AppDelegate.m, please select
AppDelegate.swift, please select
Please select the project file with the extension of
Basic push capability: normal push notification capability, which does not contain features such as push data reach statistics and rich media push.
Notification service extension plugin is mainly used to calculate the reach rate of pushes and implement features such as rich media push.
Xcodewill generate a provisioning file for your notification service extension plugin on the Apple Developer platform.
Xcode, you need to manually generate a provisioning file on the Apple Developer platform. Otherwise, the application cannot be installed on a real device for debugging. The steps are as follows:
Go to the Apple Developer platform to apply for a bundle identifier for the notification service extension plugin.
Bundle identifier naming rule: (main target Bundle Identifier).TPNSService.
Apply for a provisioning file containing the bundle identifier.
Bundle Identifier and
Provisioning Profile of the extension plugin as the bundle identifier and provisioning file you applied for respectively.
- If you are integrating TPNS for the first time, we recommend you check items 5 and 6 at the same time; otherwise, the push reach data cannot be obtained, and rich media pushes cannot be delivered.
- You can integrate configuration item 5 or 6 separately or integrate both of them at the same time as needed by your project.
After the above 6 configuration items are set, the Quick Integration button will become blue and clickable. Then, click it.
After successful integration, the following pop-up window will be displayed.
Connect your iPhone to Xcode, install the application, and view the logs in the console. If a log similar to the one below is displayed, the client has properly integrated the SDK.
[TPNS] Current device token is 9298da5605c3b242261b57****376e409f826c2caf87aa0e6112f944 [TPNS] Current TPNS token is 00c30e0aeddff1270d8****dc594606dc184
If the token cannot be found, please check the error code returned by the registration API and troubleshoot as instructed in Error Codes.