Enable Intercom push notifications in a Meteor web app - javascript

We use Intercom in our Meteor app. We only call Intercom in Javascript like Intercom('boot') for instance (as described in their documentation for single page web apps).
This all works fine so far, except the push notifications. The documentation assumes Intercom is installed directly into a Cordova app.
Has anyone managed to get intercom push notifications to work on Android / iOS with a Meteor app?

first, you should know I haven't tested this myself, but I am familiar with both Meteor and Intercom. That said, here are my thoughts on a path to success:
First, you would want to add this to your mobile-config.js file:
App.setPreference('intercom-app-id', 'xxxxxxxxxx');
App.setPreference('intercom-ios-api-key', 'ios_sdk-xxxxxxxx');
App.setPreference('intercom-android-api-key', 'android_sdk-xxxxxxxxx');
Then, you can use the Cordova functionality something like this:
if (Meteor.isCordova) {
// define values for userId and phoneNumber...
intercom.registerIdentifiedUser({userId: userId,phone:phoneNumber});
}
...
I'm not entirely sure how you're trying to use push notifications, but let me know your thoughts on this or if this helps. Thanks!

Related

Javascript - How to get app version/details in play store through api

Hello I would like to get the version of my app in the play store using javascript, I'm using it as a reference to get updates with users when they are already outdated with the app. Like iOS there is api link to get details from your app through bundle id
http://itunes.apple.com/lookup?bundleId=yourbundleid
now I would like to do the same on android but i cant seem to find any proper api which came from android itself.
Any idea where to look? thanks

How to update my cordova/phonegap mobile application remotely in android?

I have written the mobile app in cordova + angularjs + sqlite. I need to distribute it directly from my server to devices not through the google play.
Now I need to update javascript files stored in www directory on android device. I tried file transfer from app directory (/data/data/my.application.directory/) to some public device directory or server and vice versa - no problem. But problem is the www directory is part of file:///android_asset/ that is read only so I am not able to store any data in there.
Any idea? Thanks.
This is the way I'm using for updating my app and I'm not using Google Play or other stores:
I'm using this cordova plugin : https://github.com/whiteoctober/cordova-plugin-app-version to check my actual app version
cordova.getAppVersion.getVersionNumber().then(function (version)
{
if(version)
// Check the server reference version
});
After, I'm sending the app version number to the server
The server checks the difference between the version sent and the reference version
If the device app version is older, I'm returning the new version to my app client
You provide little information about your application, your code and what you are trying to do, but let me try to help you either way.
If what you want to do is modifying files in the www directory in android clients already shipped/downloaded, forget about it, you would need direct access to the device, and this code is bundled when you ship it.
If you are looking for a hot code push solution, there might be a way of doing so installing additional cordova plugins
When you publish your application on the store - you pack in it all your web content: html files, JavaScript code, images and so on. There are two ways how you can update it:
Publish new version of the app on the store. But it takes time,
especially with the App Store.
Sacrifice the offline feature and load all the pages online. But as
soon as Internet connection goes down - application won't work.
Solution: install cordova-hot-code-push

How To Interface Android/iOS App With Cordova Hybrid Application

I need some help in order to interface a native Android/iOS app with my Cordova Hybrid Application and send messages from each to other.
Can I use in total freedom cordova.exec command to send messages to the native application?
Must I create a plugin to embed it?
May you suggest me an example that fits with Cordova 5.0 version?
How can I wrap cordova.exec into an Angular service?
Cordova exec is not a function to execute anything on your device.
It's a function to call native code from the javascript but the function you call has to be either from the cordova framework, or from a plugin.
If you want to communicate between apps, you will have to either make your plugin using native code or maybe you can find a plugin already doing it.
For android you can communicate between apps using intents, for ios I have no idea.
You can have a look at the app launcher plugin, it covers the launching an app from an other app part.
For the passing parameters and receiving result part, on android it's easy, you just have to add parameters to the intent.
For IOS, you can read this document.

detect Android app is installed or not in device using javascript or jquery

I build a webapp and I have social links in my webapp.
I am facing an issue regarding this. If I am having facebook installed in my device then on click of the share link it should open the native app instead of opening in browser.
And incase if I doesnt have any native app installed then it should automatically redirect to browser.
Here it is the code what I have tried:
Javascript:
if(isAndroid){
fb://profile//www.facebook.com/sharer/sharer.php // to open in native browser
http://wwww.facebook.com // to open in web browser.
}
How do I handle this urls...
Please help me out.
This is not possible, for privacy reasons.
See This answer
You can make Hybrid Application.
What you just need to do is ADD WEB INTERFACE which will make call to native source code through javascript and also get return value.
So you can write native function which will return if application is installed. Once you set this interface you can use it further for open that app and passing intent and all that.
You can do it easily. Start Here:
https://developer.android.com/guide/webapps/webview.html

sencha android native app and facebook sdk

I have a problem with my sencha app, it uses facebook sdk javascript to log in, of course in the browser it works perfectly because facebook authorizes the domain name. but when i turn my app into a native android app, facebook rejects the app saying the given url is not allowed.
I have tried authorizing it as a native android app getting the key hash from the keystore I used, and putting in the facebook app with no success maybe i am missing something i would greatly appreciate any help in pointing me in the right direction
I solved it using the facebook connect plugin for phonegap and phonegap created by dave johnson
its in git hub
https://github.com/davejohnson/phonegap-plugin-facebook-connect/
You need to use the FB JavaScript library, not connect... Your best bet is to look at Jog With Friends in the ST2 examples directory to see how integration is handled

Categories