Release Notes
Announcements
Packages/manifest.json file and add relevant dependencies:{"dependencies": {..."com.tencent.timpush.unity": "https://github.com/TencentCloud/TIMSDK.git#push_unity"}}

UnityIMPush.mm under the directory Assets/Plugins/iOS (if the directory does not exist, create it manually), and implement the - businessID protocol method in the file to return the certificate ID. See the implementation as follows:#import "TPush/TPush.h"#import "UnityAppController.h"@interface UnityAppController (ThirdPartyExtension) <TIMPushDelegate>- (int)businessID;- (NSString *)applicationGroupID;@end@implementation UnityAppController (ThirdPartyExtension)#pragma mark - TIMPush- (int)businessID {//Certificate ID from the previous step console, such as 1234567int kBusinessID = 1234567;return kBusinessID;}- (NSString *)applicationGroupID {//AppGroup IDreturn kTIMPushAppGroupKey;}- (BOOL)onRemoteNotificationReceived:(NSString *)notice {// custom navigatereturn NO;}@end
timpush-configs.json file to the Assets/Plugins/Android directory of the project. If the directory does not exist, create it manually.
File > Build Settings > Player Settings, then go to Publishing Settings > Build in the Android platform settings and check the following three configurations:
Assets/Plugins/Android/launcherTemplate.gradle file, add the dependencies configuration at the end of the file, and as needed, introduce all or part of the manufacturer's push packages. Only by introducing the corresponding manufacturer's push package can you enable its native push capability.dependencies {// Integration of the push main package is mandatoryimplementation 'com.tencent.timpush:tpush:VERSION'// other need packagesimplementation 'androidx.appcompat:appcompat:1.3.0'implementation 'com.google.code.gson:gson:2.10.1'// Integrate FCM push packageimplementation 'com.tencent.timpush:fcm:VERSION'// If only the FCM channel is needed, the following packages do not need to be integrated; if you want to prioritize the FCM channel, call the API forceUseFCMPushChannelimplementation 'com.tencent.timpush:huawei:VERSION'implementation 'com.tencent.timpush:xiaomi:VERSION'implementation 'com.tencent.timpush:oppo:VERSION'implementation 'com.tencent.timpush:vivo:VERSION'implementation 'com.tencent.timpush:honor:VERSION'implementation 'com.tencent.timpush:meizu:VERSION'}
APPID and APPKEY need to be added to the manifest file, which can be done by modifying the Assets/Plugins/Android/launcherTemplate.gradle file.// Assets/Plugins/Android/launcherTemplate.gradleandroid {...defaultConfig {...manifestPlaceholders = ["VIVO_APPKEY" : "The cert APPKEY assigned to your app","VIVO_APPID" : "The cert APPID assigned to your app","HONOR_APPID" : "The cert APPID assigned to your app"]}}
Assets/Plugins/Android/JsonConfigs. Create the directory manually if it does not exist.



Assets/Plugins/Android/baseProjectTemplate.gradle file, add the following configurations under buildscript -> dependencies (if it is necessary to add a new buildscript, place it at the top of the file):Assets/Plugins/Android/baseProjectTemplate.gradle file, add the following configurations under buildscript -> dependencies:buildscript {dependencies {...classpath 'com.huawei.agconnect:agcp:1.6.0.300'classpath 'com.hihonor.mcs:asplugin:2.0.1.300'classpath 'com.google.gms:google-services:4.3.15'}}
Assets/Plugins/Android/settingsTemplate.gradle file, add the following repository configurations under buildscript -> repositories and allprojects -> repositories:pluginManagement {repositories {gradlePluginPortal()mavenCentral()maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }// Configure the Maven repository address for HMS Core SDK.maven {url 'https://developer.huawei.com/repo/'}maven {url 'https://developer.hihonor.com/repo'}}}dependencyResolutionManagement {...repositories {mavenCentral()maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }// Configure the Maven repository address for HMS Core SDK.maven {url 'https://developer.huawei.com/repo/'}maven {url 'https://developer.hihonor.com/repo'}}}}
Assets/Plugins/Android/baseProjectTemplate.gradle file, add the following configurations under buildscript:buildscript {repositories {mavenCentral()maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }// Configure the Maven repository address for HMS Core SDK.maven {url 'https://developer.huawei.com/repo/'}maven {url 'https://developer.hihonor.com/repo'}}dependencies {...classpath 'com.google.gms:google-services:4.2.0'classpath 'com.huawei.agconnect:agcp:1.4.1.300'classpath 'com.hihonor.mcs:asplugin:2.0.1.300'}}
Assets/Plugins/Android/settingsTemplate.gradle file, add the following repository configurations under allprojects -> repositories:allprojects {...repositories {mavenCentral()maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }// Configure the Maven repository address for HMS Core SDK.maven {url 'https://developer.huawei.com/repo/'}maven {url 'https://developer.hihonor.com/repo'}}}
buildscript and allprojects:buildscript {repositories {mavenCentral()maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }// Configure the Maven repository address for HMS Core SDK.maven {url 'https://developer.huawei.com/repo/'}maven {url 'https://developer.hihonor.com/repo'}}dependencies {...classpath 'com.google.gms:google-services:4.2.0'classpath 'com.huawei.agconnect:agcp:1.4.1.300'classpath 'com.hihonor.mcs:asplugin:2.0.1.300'}}allprojects {repositories {mavenCentral()maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }// Configure the Maven repository address for HMS Core SDK.maven {url 'https://developer.huawei.com/repo/'}maven {url 'https://developer.hihonor.com/repo'}}}
Assets/Plugins/Android/launcherTemplate.gradle file, add the following configurations:apply plugin: 'com.google.gms.google-services'apply plugin: 'com.huawei.agconnect'apply plugin: 'com.hihonor.mcs.asplugin'

PushListener listener = new PushListener(onRecvPushMessage: (message) => {Debug.Log($"Received push message: Title:{message.title}, Content:{message.desc}, Passthrough content:{message.ext}, Message ID:{message.messageID}");}, onRevokePushMessage: (messageID) => {Debug.Log($"Revoke push message ID: {messageID}");}, onNotificationClicked: (ext) => {Debug.Log($"Click to push message: {ext}");});PushManager.AddPushListener(listener);
PushManager.RegisterPush method, you can receive offline push notifications.PushManager.RegisterPush(sdkAppId: your sdkAppId, appKey: "client key", new PushCallback(onSuccess: (data) => {Debug.Log($"Push registration successful: {data}");}, onError: (errCode, errMsg, data) => {Debug.Log($"Push registration failed: error code:{errCode}, error info:{errMsg}");}));


Callback Address Configuration | Receipt ID Configuration Chat Console |
![]() Receipt Address: Singapore :https://apisgp.im.qcloud.com/v3/offline_push_report/vivo Korea: https://apikr.im.qcloud.com/v3/offline_push_report/vivo USA: https://apiusa.im.qcloud.com/v3/offline_push_report/vivo Germany: https://apiger.im.qcloud.com/v3/offline_push_report/vivo Indonesia: https://apiidn.im.qcloud.com/v3/offline_push_report/vivo China: https://api.im.qcloud.com/v3/offline_push_report/vivo | ![]() |
Enable Receipt Switch | Configure Receipt Address |
![]() | ![]() |
- applicationGroupID method in the AppDelegate.m file. For reference, see the Push Parameter Configuration section, which returns the App Group ID (for generation method, see Manufacturer Configuration - Generate App GroupID).-didReceiveNotificationRequest:withContentHandler: method.@implementation NotificationService- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {//appGroup indicates the App Group shared between the main APP and Extension. The App Groups capability needs to be configured in the main APP's Capability.//format is group + [main bundleID] + key//for example group.com.tencent.im.pushkeyNSString * appGroupID = kTIMPushAppGroupKey;__weak typeof(self) weakSelf = self;[TIMPushManager handleNotificationServiceRequest:request appGroupID:appGroupID callback:^(UNNotificationContent *content) {weakSelf.bestAttemptContent = [content mutableCopy];// Modify the notification content here...// self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];weakSelf.contentHandler(weakSelf.bestAttemptContent);}];}@end

Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback