Usage of OnNavigatedTo from inside a module #10539
-
Hi, I'm trying to create a native module for my C++/WinRT app in react-native. The objective is to create a native implementation of the google oauth2 flow. I am using this sample as a base https://github.com/googlesamples/oauth-apps-for-windows/tree/master/OAuthUniversalApp In the sample the authentication is done on the browser and the OnNavigatedTo method of the app is overwriten to allow the app to get the authorization code from the callback url there's a way of overwrite this method from inside the module or at least to subscribe to an event to get this code? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The modules don't have a built in API to interact with the Application object, or the Page, or the Window. Which I think is what you're looking for here. This would be something you could accomplish in an app, but not obviously today from the module without some creative thinking. |
Beta Was this translation helpful? Give feedback.
-
There's a way I could call the native module from the app class? That way I could include a installation manual step where the developer overrides the app onNavigatedTo method and from there call the module method to handle the response from the auth page |
Beta Was this translation helpful? Give feedback.
The modules don't have a built in API to interact with the Application object, or the Page, or the Window. Which I think is what you're looking for here. This would be something you could accomplish in an app, but not obviously today from the module without some creative thinking.