momo-wallet / mobile-sdk

If your business have a mobile app. You can use this SDK to integrate your mobile with MoMo App
80 stars 54 forks source link

[React Native - iOS] Momo Response Issue #5

Closed ncdai closed 5 years ago

ncdai commented 5 years ago

Hi MoMo Team!

I am having problems with React Native MoMo SDK on iOS.

How to determine if the user does not open the MoMo App or the user does not download the App or the user exits the app on the phone (does not receive a token).

Currently I can only handle when I receive a token. EventEmitter.addListener('RCTMoMoNoficationCenterRequestTokenReceived', this.handleMomoResponse)

I want to receive one event like : RCTMoMoNoficationCenterRequestTokenFailed

Please help me solve this problem.

Thank you so much!

momodevelopment commented 5 years ago

@ncdai3651408 We have updated the event name RCTMoMoNoficationCenterRequestTokenState to cover issues
status = 0 Parameters valid. Ready to open MoMo app - user exits the app status = 1 canOpenURL failed for URL MoMo app, user does not download the App or LSApplicationQueriesSchemes config not finished status = 2 Parameters invalid

npm install the latest version usage react-native-momosdk@1.2.5

EventEmitter.addListener('RCTMoMoNoficationCenterRequestTokenState',(response) => {
     //UX definition
})

Hope this change will help you!