问题
Actually I want to save an offer to 'Google Wallet'. As I haven't worked on it before I did some RND and came across this documentation. In this documentation they are creating Offer class object at Android side but, in my case the Offer class object is creating at our back-end server and I'm getting ready-made JWT token just by hitting one API to our back-end server, now using that JWT token I want to save the offer to the 'Google-Wallet'. Now my question is, is it possible? if Yes please tell me How? Also please let me know if I can provide more details so that you can understand my problem. Thank you
回答1:
I have been working on this at PassNinja. The most convenient method for your use case would be to use the JWT link and intent.
Fill in your generated JWT and class ID:
https://www.android.com/{classid}/savetoandroidpay/{jwt_generated}
Use an ACTION_VIEW
intent to open the deep link from the Save to Google Pay button.
Make sure that the button that triggers the intent uses the Brand guidelines.
Intent webIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.android.com/payapp/savetoandroidpay/" + JWT));
context.startActivity(webIntent)`
For more info on deep links and Save to Google Pay, here is a video.
来源:https://stackoverflow.com/questions/52202229/how-to-save-an-offer-to-google-wallet-using-jwt