Showing
2 changed files
with
14 additions
and
4 deletions
| @@ -22,6 +22,8 @@ import { UIAbility, AbilityConstant, Want } from '@kit.AbilityKit'; | @@ -22,6 +22,8 @@ import { UIAbility, AbilityConstant, Want } from '@kit.AbilityKit'; | ||
| 22 | import { MethodChannel } from '@ohos/flutter_ohos'; | 22 | import { MethodChannel } from '@ohos/flutter_ohos'; |
| 23 | import { notificationManager } from '@kit.NotificationKit'; | 23 | import { notificationManager } from '@kit.NotificationKit'; |
| 24 | import { common } from '@kit.AbilityKit'; | 24 | import { common } from '@kit.AbilityKit'; |
| 25 | +import { PushPlatform } from './PushPlatform'; | ||
| 26 | + | ||
| 25 | const TAG: string = "PushPluginMethodChannelHandler"; | 27 | const TAG: string = "PushPluginMethodChannelHandler"; |
| 26 | 28 | ||
| 27 | export default class PushPluginMethodChannelHandler implements MethodCallHandler { | 29 | export default class PushPluginMethodChannelHandler implements MethodCallHandler { |
| @@ -86,11 +88,9 @@ export default class PushPluginMethodChannelHandler implements MethodCallHandler | @@ -86,11 +88,9 @@ export default class PushPluginMethodChannelHandler implements MethodCallHandler | ||
| 86 | try { | 88 | try { |
| 87 | const pushToken: string = await pushService.getToken(); | 89 | const pushToken: string = await pushService.getToken(); |
| 88 | const map:Map<string,string> =new Map<string,string>() | 90 | const map:Map<string,string> =new Map<string,string>() |
| 89 | - const params:Map<string,string> =new Map<string,string>() | ||
| 90 | - params.set("platformName","huawei_ohos") | ||
| 91 | - params.set("regId",pushToken) | 91 | + const pushPlatform = new PushPlatform("huawei_ohos",pushToken) |
| 92 | map.set("type","ReceiveRegisterResult") | 92 | map.set("type","ReceiveRegisterResult") |
| 93 | - map.set("params", JSON.stringify(params)) | 93 | + map.set("params", JSON.stringify(pushPlatform)) |
| 94 | this.methodChannel?.invokeMethod("onListener",map) | 94 | this.methodChannel?.invokeMethod("onListener",map) |
| 95 | result.success(true) | 95 | result.success(true) |
| 96 | } catch (err) { | 96 | } catch (err) { |
-
Please register or login to post a comment