这里的主要目标是生成和接收 Push Notifications
使用iOS
Delphi 10 Seattle。
我正在尝试关注此视频,但到目前为止,我只能成功发送推送通知。
有这个令人难以置信的教程帮助我更好地了解 App ID、配置文件、证书、PEM 文件、SSL 连接等等。这基本上就是我现在的看法(是的,那是一块真正的板):
但有趣的是我需要在 Delphi 链接的 Provisioning Profile。与APNS证书必须是同一个反向域名。
我能够想象我在 Delphi 的 Apple 会员中心创建Provisioning Profile
的.Push Support
Tools > Options > Provisioning
但是我看不到任何不属于iOS Team Provisioning Profile的Provisioning Profiles Project > Options > Provisioning
,即使提供CFBundleIdentifier
的 atVersion Info
与 Xcode 中的相同 Bundle Identifier (App ID) 匹配。
Team Prefix
如果我在上包含 ,我只能运行应用程序Bundle ID
,但我觉得我一定做错了什么。
仅当应用程序具有与其链接的正确证书时,通知才会起作用。
这就是我获取应用程序令牌的方式:
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;
我费了很大的力气才到这里,但我仍然没有收到推送通知。
我必须做的可能的错误是什么?