Android | iOS |
| |
flutter pub addtencent_cloud_chat_push
google-services.json
file, in order to implement the offline push feature.Vendor Push Platform | Configuring in the Chat console |
| |
timpush-configs.json
file to the assets
directory of the application module, and add the google-services.json
to the project app directory.Select and download the configuration file timpush-configs.json | Download the file google-services.json | Add to the project |
| | |
build.gradle
file under the project's app directory, add the following dependency:implementation "com.tencent.timpush:fcm: xxxxxx"
build.gradle
needs to correspond with the tencent_cloud_chat_push
version.MainActivity
under your project's android path, create a new Application file category, which could be named MyApplication
.package xxxx.xxxx.xx import com.tencent.chat.flutter.push.tencent_cloud_chat_push.application.TencentCloudChatPushApplication; public class MyApplication extends TencentCloudChatPushApplication { @Override public void onCreate() { super.onCreate(); } }
extend TencentCloudChatPushApplication
and ensure that onCreate()
method is called in super.onCreate();
.android/app/src/main/AndroidManifest.xml
file, then add a specific android:name
parameter to the <application>
Tag, which is linked to your newly created Definition Application
class as shown in the figure:build.gradle
file, under buildscript -> dependencies, add the following configuration:buildscript {dependencies {classpath 'com.google.gms:google-services:4.3.15'}}
build.gradle
file under the project's app directory, add the following configuration:apply plugin: 'com.google.gms.google-services'
TencentCloudChatPush().registerPush
method, it necessitates the transmission of BackDefinition's click callback function.apnsCertificateID
, the iOS push certificate ID, and androidPushOEMConfig
, the Android push vendor configuration. These two configurations were previously specified in the initial steps; should there be no need for amendment, there is no requirement to input them again.TencentCloudChatPush().registerPush(onNotificationClicked: _onNotificationClicked);
onAppWakeUpEvent
.TencentCloudChatPush().registerOnAppWakeUpEvent(onAppWakeUpEvent: () {// TODO: log in operation});
TUIOfflinePushInfo offlinePushInfo = TUIOfflinePushInfo();offlinePushInfo.title = "Flutter TUICallKit";offlinePushInfo.desc = "This is an incoming call from Flutter TUICallkit";offlinePushInfo.ignoreIOSBadge = false;offlinePushInfo.iOSSound = "phone_ringing.mp3";offlinePushInfo.androidSound = "phone_ringing";offlinePushInfo.androidFCMChannelID = "fcm_push_channel";offlinePushInfo.iOSPushType = TUICallIOSOfflinePushType.VoIP;TUICallParams params = TUICallParams(offlinePushInfo: offlinePushInfo);TUICallKit.instance.call(callUserId, TUICallMediaType.audio, params);
Was this page helpful?