From 6c71c40a3aab2628882b14e985cb3b6d1afadc84 Mon Sep 17 00:00:00 2001 From: dujiepeng <347302029@qq.com> Date: Thu, 14 Apr 2022 15:24:22 +0800 Subject: [PATCH] update --- FlutterQA.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/FlutterQA.md b/FlutterQA.md index 8f55b4d8..85ab4d73 100644 --- a/FlutterQA.md +++ b/FlutterQA.md @@ -1,7 +1,8 @@ iOS如何绑定deviceToken? -```objectivec +OC +```objectivec #import "AppDelegate.h" // 引入环信SDK #import @@ -14,11 +15,11 @@ iOS如何绑定deviceToken? - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - + + // ... - - + + // // 获取UNUserNotificationCenter并申请[badge, alert, sound]权限。 UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; [center requestAuthorizationWithOptions: @@ -31,8 +32,8 @@ iOS如何绑定deviceToken? }); } }]; - - + + return YES; } @@ -45,11 +46,11 @@ iOS如何绑定deviceToken? @end - ``` -```swift +Swift +```swift import UIKit import Flutter // 引入环信SDK @@ -62,7 +63,7 @@ import HyphenateChat didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self); - + // 获取UNUserNotificationCenter并申请[badge, alert, sound]权限。 let center = UNUserNotificationCenter.current(); center.requestAuthorization(options: [.badge, .alert, .sound]) { granted, error in @@ -73,7 +74,7 @@ import HyphenateChat } } } - + return super.application(application, didFinishLaunchingWithOptions: launchOptions) } // 收到系统deviceToken获取成功回调 @@ -82,8 +83,4 @@ import HyphenateChat EMClient.share.registerForRemoteNotifications(withDeviceToken: deviceToken, completion: nil) } } - - - - ```