luniehq / lunie

Lunie is staking, simplified ✨
https://lunie.io
Apache License 2.0
280 stars 100 forks source link

intercom is not working in mobile #3326

Closed jbibla closed 4 years ago

jbibla commented 4 years ago

intercom has a whitelist and the URL gets obscured in the native apps so they cannot be whitelisted. i have contacted support and they recommended the intercom / ionic docs.

there is a way to install intercom for mobile apps with ionic that should be researched.

mariopino commented 4 years ago

Related information:

https://ionicframework.com/docs/native/intercom

https://developers.intercom.com/installing-intercom/docs/cordova-phonegap-configuration

https://github.com/intercom/intercom-cordova

faboweb commented 4 years ago

How do you want to solve this? Maybe good to discuss a plan.

mariopino commented 4 years ago

Sure @faboweb! My plan is to integrate cordova-plugin-intercom cordova plugin into the ionic app.

That way we should be able to add a custom launcher when needed using intercom.displayMessenger(); call.

Another related link, an example cordova app using this:

https://github.com/intercom/intercom-cordova/tree/master/Example

faboweb commented 4 years ago

sounds good. let me know when we need to add the environment variables to the build pipeline. I would propose not doing push things for a first version. what do you think?

mariopino commented 4 years ago

sounds good. let me know when we need to add the environment variables to the build pipeline. I would propose not doing push things for a first version. what do you think?

Agree, I'll send you a message before push to discuss the best way to do it

mariopino commented 4 years ago

The cordova plugin was giving me an error ERROR: Could not get unknown property 'cdvCompileSdkVersion' for project ':app' of type org.gradle.api.Project. and don't want to waste more time on it so I decided to try this capacitor plugin:

https://github.com/stewwan/capacitor-intercom

I have it working in Android, currently attached to portfolio page.

Some thoughts about it:

faboweb commented 4 years ago

What should be the best intercom userId generation possibility, something like lunie-android-1234?

sounds good

Best way to only load in mobile.

check here: https://github.com/luniehq/lunie/pull/3209/files#diff-1c90ff38a08209f9ebd4d05d1e43358eR53

Best place to initialize intercom (initializeApp.js?)

sounds good. maybe check for config.isMobile

I think we should use the same css selector to load intercom either in mobile or desktop.

can it be just the same button?

mariopino commented 4 years ago

can it be just the same button? Yep, this is what I mean.

mariopino commented 4 years ago

check here: https://github.com/luniehq/lunie/pull/3209/files#diff-1c90ff38a08209f9ebd4d05d1e43358eR53

Perfect, Intercom needs push notifications just like in that pr using PushNotifications.register().

faboweb commented 4 years ago

let's leave the push notification out for now?

mariopino commented 4 years ago

let's leave the push notification out for now?

I think not, push notifications are needed by Intercom to receive the responses from the Lunie Team.

We can enable it in this pr or wait until your pr gets merged. What do you think it's best?

faboweb commented 4 years ago

are you certain they don't receive the messages anyway when the app is open?

mariopino commented 4 years ago

Not needed, you are right!