本文介绍了Delphi 10.1 Android如何获取Firebase设备令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试过:
APushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.GCM);
APushService.AppProps[TPushService.TAppPropNames.GCMAppID] := '"mobilesdk_app_id" '; // my "mobilesdk_app_id" from google-services.json
AServiceConnection := TPushServiceConnection.Create(APushService);
AServiceConnection.Active := True;
AServiceConnection.OnChange := OnServiceConnectionChange;
AServiceConnection.OnReceiveNotification := OnReceiveNotificationEvent;
ADeviceID := APushService.DeviceIDValue[TPushService.TDeviceIDNames.DeviceID];
AdeviceToken := APushService.DeviceTokenValue[TPushService.TDeviceTokenNames.DeviceToken];
ADeviceID
正确显示,而 AdeviceToken
空白显示.
ADeviceID
comes up correctly, by AdeviceToken
comes up blank.
推荐答案
原因是:
APushService.AppProps[TPushService.TAppPropNames.GCMAppID] := '"mobilesdk_app_id"
错误,该属性与 mobilesdk_app_id 不相关.它与 SENDER ID 有关.可以在设置->云消息传递->发件人ID 下找到该值.输入该值后,您将收到令牌.
is wrong and this property does not relate to the mobilesdk_app_id. It's related to the SENDER ID. This value can be found under settings -> cloud messaging -> sender Id. Once you put this value, you will receive the token.
这篇关于Delphi 10.1 Android如何获取Firebase设备令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!