How to save an Offer to Google Wallet using JWT?

末鹿安然 提交于 2019-12-21 05:23:32

问题


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

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