在Delphi 10 Seattle上接收iOS推送通知
这里的主要目标是使用Delphi 10 Seattle生成和接收 Push Notifications
。
我试图跟随这个video,但到目前为止,我只能成功地发送推送通知。
有这个令人难以置信的教程 ,帮助我更好地了解应用程序ID,供应configuration文件,证书,PEM文件,SSL连接等。 这基本上是我现在看到的( 是的,这是一个真正的董事会 ):
但有趣的是关于我需要在delphi链接的configuration文件。 它必须与APNS证书具有相同的反向域名。
我可以通过在Delphi的Tools > Options > Provisioning
在苹果会员中心创build的Push Support
来可视化Provisioning Profile
。
但是,即使提供的Version Info
中的CFBundleIdentifier
与来自Xcode的Bundle标识符(App ID)相匹配,我也无法在Project > Options > Provisioning
看到任何不属于iOS Team Provisioning Profile的供应configuration文件 。
我只能运行该应用程序,如果我在Team Prefix
Bundle ID
包括Team Prefix
,但我觉得我一定是做错了什么。
通知只有在应用程序链接了正确的证书时才有效。
这就是我得到的应用程序令牌:
procedure TFormPush.Button1Click(Sender: TObject); var FormPush : TFormPush; APushService : TPushService; AServiceConnection: TPushServiceConnection; ADeviceID : string; AdeviceToken: string; begin APushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.APS); AServiceConnection := TPushServiceConnection.Create(APushService); AServiceConnection.Active := True; ADeviceID := APushService.DeviceIDValue[TPushService.TDeviceIDNames.DeviceID]; AdeviceToken := APushService.DeviceTokenValue[TPushService.TDeviceTokenNames.DeviceToken]; ShowMessage(AdeviceToken); end;
我花了很大的力气来到这里,但是我仍然没有收到推送通知。
我可能犯的错误是什么?