I'm using OneSignal to notify my Android users. Only the notifications only appear for those who have already opened the application. Is there any service that can be put into the app to always make it active and receive notifications?
I'm using OneSignal to notify my Android users. Only the notifications only appear for those who have already opened the application. Is there any service that can be put into the app to always make it active and receive notifications?
Yes, it does. I always use this service.
By the cordova platform, phonegap and Intel XDK and etc ...
window.plugins.OneSignal
.startInit("coloque aqui seu app_id ")
.inFocusDisplaying(window.plugins.OneSignal.OSInFocusDisplayOption.None)
.handleNotificationReceived(function(jsonMessage){
// Coloque aqui as funçoes de retorno da notificação
})
.handleNotificationOpened(function(){
// Coloque aqui as funçoes de retorno para click da notificação
})
.endInit();
window.plugins.OneSignal.getIds(function(ids) {
// Pegando e registrando id do usuario de cada aparelho
// Chave de autenticação de envio e retorno
windows.localStorage.setItem('idsAutoPush', ids.userId);
});