Receiving iOS Push Notifications on Delphi 10 Seattle

假装没事ソ 提交于 2019-12-06 00:58:55

问题


The main goal here is to generate and receive Push Notifications for iOS using Delphi 10 Seattle.

I'm trying to follow this video but so far I've been able only to successfully send push notifications.

There's this incredible tutorial that helped me to understand better about App ID's, Provisioning Profiles, Certificates, PEM files, SSL connections and so on. This is basically how I see it now (yes, thats a real board):

But the funny thing is about the Provisioning Profile that I need to link at Delphi. It must be the same reverse domain name as the APNS certificate.

I'm able to visualize the Provisioning Profile with Push Support I created at Apple's Member Center at Delphi's Tools > Options > Provisioning.

But I'm not able to see any Provisioning Profiles that doesn't belong to a iOS Team Provisioning Profile at Project > Options > Provisioning, even though the provided CFBundleIdentifier at Version Info matches the same Bundle Identifier (App ID) from Xcode.

I can only run the application if I include the Team Prefix on the Bundle ID, but I feel like I must be doing something wrong.

The notifications will only work if the application has the correct certificates linked to it.

And this is how I'm getting the application token:

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;

It took me a lot of effort to get here, but I'm still failing to receive the push notifications.

What are the possible mistakes I must be doing?

来源:https://stackoverflow.com/questions/34087495/receiving-ios-push-notifications-on-delphi-10-seattle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!