离子原生推送注册格式更改了吗? [英] Ionic native push registration format changed?

查看:173
本文介绍了离子原生推送注册格式更改了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定为什么,但是推送注册的界面似乎已更改?

I am not sure why but it seems that the interface for push registration changed?

我的应用遵循

https://ionicframework.com/docs/v3/native/push/

pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));

其中registration以前是以下类型

export interface PushDevice{
    registrationId: string;
    registrationType: string;
}

但是我现在得到

{"registrationId":"{length=32,bytes=0x459ca46ab66f4fe790220809215176d6...21b3436d13e78c64}","registrationType":"APNS"}

registrationID曾经是字符串,但现在是字典.我现在应该如何处理此ID?我必须以某种方式将其转换为推送令牌...发生了什么变化?我查看了电话间隙插件代码,但找不到它... https://github.com/phonegap/phonegap-plugin-push/blob/master/src/ios/PushPlugin.m

registrationID used to be a string, but now is a dictionary. How shall I handle this ID now? I have to convert it to a push token somehow... What changed? I looked into the phone gap plugin code but I can not find it... https://github.com/phonegap/phonegap-plugin-push/blob/master/src/ios/PushPlugin.m

推荐答案

最后找到了线索.似乎随着iOS 13的发布而改变了.

Finally found a lead. Seems this changed with the release of iOS 13.

https://forums.developer.apple.com/thread/117545

Cordova推送插件必须更新到v2.3.0(我尚未对此进行测试),但是我的当前版本失败了,因为v2.2.3正在通过错误的方法访问registrationId.

The Cordova push plugin has to be updated to v2.3.0 (I have not tested this yet), but my current version is failing because v2.2.3 is accessing the registrationId through a wrong method.

https://github.com/phonegap/phonegap-plugin-push /issues/2832 https://github.com/proreact/phonegap-plugin-push/commit/486c8f206536995c80101487b0fed1502edd5754

这篇关于离子原生推送注册格式更改了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆