Reload Issue After Inserting OneSignal Plugin

Reload Issue After Inserting OneSignal Plugin

  

Dear Mates,

I've added the OneSignal module(plugin) to the my application, but after that I'm having a reload issue in the browser and OutSystems Now. I'm always redirected to this page in the image after pressing any redirection link or button. 

The .APK file is working as expected on my mobile device so this seems to be on the browser and OutSystems Now only. 


Your Help is Very appreciated.

Best Regards,

Mohamed AlMokadem 

Solution

Hi Mohamed,

Plugins like OneSignal can't be used in the browser or with OutSystems Now (OutSystems Now has a number of supported plug-ins, but you can't add any).

Most likely, in your app you try to access the plug-in without checking whether it is available, causing an Exception to occur, which redirects to the error page of your screen shot. Therefore, always check whether the plug-in is available, using the CheckXxxPlugin Action:

If it returns False, the plug-in is not available (which is always the case in a browser), and you shouldn't try to use the other plug-in Actions.

Solution

Dear Kilian, 

Thanks for your help.

I've made it as you said but still having the same error, I'm only using the plugin function here in the login action. 


Hi Mohamed,

In that case debugging is the answer to find your problem :).

Hi Kilian, 


This action happens after redirecting to the called screen then it redirect again to this error screen so can't catch it through debugging 

Here is this message from the Error section  "Cannot read property 'previousScope' of undefined"

Also Their is Another Error saying The module does not have the same user provider, I found the OneSignal module using the (current espace), see here 


Should I edit it to be User Provider not current eSpace  ?

Regards.

Hi Mohamed,

Every time you want to call something from a plug-in you need to check whether the plug-in is available, or you'll get errors. The "Cannot read property" is indeed what you get, since the app tries to use a property of an object that isn't there.

You can ignore the other error, it's ok for the OneSignalAPI eSpace to have a different user provider, as it doesn't use roles etc.

Kilian Hekhuis wrote:

Hi Mohamed,

Every time you want to call something from a plug-in you need to check whether the plug-in is available, or you'll get errors. The "Cannot read property" is indeed what you get, since the app tries to use a property of an object that isn't there.

You can ignore the other error, it's ok for the OneSignalAPI eSpace to have a different user provider, as it doesn't use roles etc.

Hi Kilian, I really appreciate your help.


ok I will ignore the user provider error, But I'm still unable to use the app neither in browser nor in Outsystems now, so is their is hidden action that calls the OneSignal plugin or any other war to prevent using the plugin in the browser. 


Regards, 

Mohamed AlMokadem 


First, check the Error Log in Service Center, and see what error is actually produced. It might well be looking at OneSignal is a bit of a wild goose chase, and the cause is something else.

Also, debug. On the Debug tab, select "Emulate using Google Chrome", press "Start Debugging" and start the app. Find out where it goes wrong.

Hi Kilian, 

Thank you for your time mate. 

I will post what was causing the error which I forgot about the Plugin block in the Layout, I didn't check that one out but we have to check another way because the CheckOneSinal will not be applicable here. 

We can check for the device type from the web patterns module for example and actually that solved the error. 


what was better is to check if device is "android" and set the OnSignalPlugin in the True part so the one signal will work on Android only. 


Note: This solution is for OutSystems Now and Browser to keep them working while developing only.   


Thanks Killian again.


Best Regards,

Mohamed AlMokadem

Great you found the cause Mohamed and thanks for reporting back. Happy coding! :)