Hi,
Please refer the info graphic .
I'm an issuer Bank App, who wants to add a card to phone's Digital Wallet.
When I hit add to Apple or Google wallet, my API call goes to a Token Requester server and then to Token Service provider.
In this process, I do get a JWT token back, but when I try to add token to Digital Wallet, I always get the message "The pass cannot be read because it is not valid".
So few question:
Is there a way to debug the token that is received by the app?
Is there any kind of API console that I can look to see what is happening and why the pass is not valid?
I, being the Issuer Bank App, a Token Service Requester and A Token Service Provider, who should be communicating with Apple servers?
Are there any documents that explicitly shows (example) the flow of adding a credit card to Digital Wallet from iOS perspective?
Any other help is appreciated.
On my end, I have done this:
public void AddToDeviceAsync(string data)
{
try
{
var dataArray = Encoding.UTF8.GetBytes(data);
if (data.Length > 0)
{
if (PKAddPassesViewController.CanAddPasses && PKPassLibrary.IsAvailable)
{
_nsData = NSData.FromArray(dataArray);
ObjCRuntime.Class.ThrowOnInitFailure = false;
_pkPass = new PKPass(_nsData, out NSError e);
if (!string.IsNullOrWhiteSpace(e?.LocalizedDescription))
{
UserDialogs.Instance.AlertAsync(e.LocalizedDescription, AppResources.Alert);
return;
}
if (!PkLibrary.Contains(_pkPass))
{
var controller = new PKAddPassesViewController(_pkPass);
var rootViewController = UIApplication.SharedApplication.Delegate.GetWindow().RootViewController;
if (rootViewController != null)
{
var topController = TopViewControllerWithRootViewController(rootViewController);
topController?.PresentViewController(controller, true, null);
}
}
else
{
UserDialogs.Instance.AlertAsync(AppResources.Pass_Already_Present, AppResources.Alert);
}
}
}
else
{
UserDialogs.Instance.AlertAsync(AppResources.Invalid_Pass_Data, AppResources.Alert);
}
}
catch (Exception e)
{
UserDialogs.Instance.AlertAsync(e.Message, AppResources.Alert);
}
}