Effect when the screen is locked | Effect in the background |
| |
target 'YourAppName' do# Uncommment the next line if you're using Swift or would like to use dynamic frameworksuse_frameworks!use_modular_headers!# Pods for Examplepod 'TIMPush', '7.9.5668'end
pod install # If you cannot install the latest version of TUIKit, run the following command to update the local CocoaPods repository list. pod repo update
Push Notification
Service
to your existing AppID.Bundle ID
must not use the wildcard *, otherwise, the remote push service cannot be used.Bundle ID
and other information, click Continue to proceed to the next step.SSL Certificates
, one for the Development environment and one for the Production environment.Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority
).*.certSigningRequest
file.*.certSigningRequest
file.Development SSL Certificate
for the development environment to your local machine.Production SSL Certificate
for your production environment to your local system.Sandbox
and Production
, which can be used for both the development and production environments.SSL Certificate
for both the development and production environments, and the system will import it into your keychain.Apple Development IOS Push Service
) and the production environment (Apple Push Services
).P12
file, be sure to set a password.offlinePushCertificateID
in AppDelegate to return the Certificate ID.import TIMPushfunc offlinePushCertificateID() -> Int32 {return kAPNSBusiId}
#pragma mark - TIMPush- (int)offlinePushCertificateID {return kAPNSBusiId;}
import TUICallKit_Swiftimport TUICallEnginelet pushInfo: TUIOfflinePushInfo = TUIOfflinePushInfo()pushInfo.title = ""pushInfo.desc = "You have a new call"pushInfo.iOSPushType = .apnspushInfo.ignoreIOSBadge = falsepushInfo.iOSSound = "phone_ringing.mp3"pushInfo.androidSound = "phone_ringing"// For OPPO, you must set the `ChannelID` to receive push messages. The `ChannelID` must be identical with that in the console.// OPPO must set a ChannelID to receive push messages. This channelID needs to be the same as the console.pushInfo.androidOPPOChannelID = "tuikit"// FCM channel ID, you need change PrivateConstants.java and set "fcmPushChannelId"pushInfo.androidFCMChannelID = "fcm_push_channel"// VIVO message type: 0-push message, 1-System message(have a higher delivery rate)pushInfo.androidVIVOClassification = 1// HuaWei message type: https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/message-classification-0000001149358835pushInfo.androidHuaWeiCategory = "IM"let params = TUICallParams()params.userData = "User Data"params.timeout = 30params.offlinePushInfo = pushInfo// Single person call example, similar for group callTUICallKit.createInstance().call(userId: "123456", callMediaType: .audio, params: params) {} fail: { code, message in}
#import <TUICallKit_Swift/TUICallKit_Swift-Swift.h>#import <TUICallEngine/TUICallEngine.h>- (TUICallParams *)getCallParams {TUIOfflinePushInfo *offlinePushInfo = [self createOfflinePushInfo];TUICallParams *callParams = [TUICallParams new];callParams.offlinePushInfo = offlinePushInfo;callParams.timeout = 30;return callParams;}- (TUIOfflinePushInfo *)createOfflinePushInfo {TUIOfflinePushInfo *pushInfo = [TUIOfflinePushInfo new];pushInfo.title = @"";pushInfo.desc = @"You have a new call";pushInfo.iOSPushType = TUICallIOSOfflinePushTypeAPNs;pushInfo.ignoreIOSBadge = NO;pushInfo.iOSSound = @"phone_ringing.mp3";pushInfo.AndroidSound = @"phone_ringing";// For OPPO, you must set the `ChannelID` to receive push messages. The `ChannelID` must be identical with that in the console.// OPPO must set a ChannelID to receive push messages. This channelID needs to be the same as the console.pushInfo.AndroidOPPOChannelID = @"tuikit";// FCM channel ID, you need change PrivateConstants.java and set "fcmPushChannelId"pushInfo.AndroidFCMChannelID = @"fcm_push_channel";// VIVO message type: 0-push message, 1-System message(have a higher delivery rate)pushInfo.AndroidVIVOClassification = 1;// HuaWei message type: https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/message-classification-0000001149358835pushInfo.AndroidHuaWeiCategory = @"IM";return pushInfo;}// Single person call example, similar for group call[[TUICallKit createInstance] callWithUserId:@"123456"callMediaType:TUICallMediaTypeAudioparams:[self getCallParams] succ:^{} fail:^(int code, NSString * _Nullable errMsg) {}];
- application:didRegisterForRemoteNotificationsWithDeviceToken:
callback returns a token for the deployment environment. In this case, the businessID should be set to the production environment's Certificate ID.- application:didRegisterForRemoteNotificationsWithDeviceToken:
callback returns a token for the development environment. In this case, the businessID should be set to the development environment's Certificate ID.
Was this page helpful?