PhoneGap - Deeplink

3
Working on a application that has native mobile functionality, We create the application via Phonegap build, however we use a deep link to reach our mobile functionality within mendix. However upon debugging we get an error whilst connecting to the application that reads unexpected "<". In the javascript of the bundle I noticed that the deeplink url returns a string containing the page html whereas the regular link contains JSON which the package.js expects. My question, is it possible to setup a mendix mobile app via a deeplink or does it need to be the default url? Thanks. Edit: I'm referring to the mxapp.initialize("applicationurl"); function and using the url of a mendix deeplink created via the deeplink module.
asked
3 answers
1

You won't be able to pass a deeplink to mxapp.initialize due to the way we load the app. Normally, you surf to a website with an index page, which loads a bunch of js. In a cordova-packaged mendix app, we have the index.html page locally, then load the client javascript dynamically (by inserting script tags). I don't think you'll be able to trigger a deeplink in this way.

If you want a custom MF to be triggered, you could enable anonymous users and then handle this by using a nav microflow.

Alternatively, you could bypass our efforts for the hybrid app altogether and write your own cordova wrapper that simply opens the deeplink. You won't be able to use any cordova plugins, though....

answered
1

Found out why,

mxapp.initialize("applicationurl");

trys to locate the JSON file on the server

however the deeplink returns html for the page I return in this instance,

if (status === 200) {
                    resolve(JSON.parse(result));
                } else if (status === 404) {
                    // If config is not found, assume the default config
                    resolve(defaultConfig);

therefore it hits the 200 response fails to parse rather than resorting back to the default config

gonna mess around more with it.

answered
0

Hi Simon,

Using URL links in your app will get you into trouble.

https://forum.mendix.com/questions/8883/Source%20for%20Phongap%20Mendix%20Developer%20App

Have a look at the phone gap intents plugin, that allow you to pickup URL requests in you app.

http://www.raymondcamden.com/2012/05/01/example-of-intents-with-phonegap

Hopefully this information will get you further,

Cheers Andries

answered