caffeinalab / ti.goosh Goto Github PK
View Code? Open in Web Editor NEWGCM/FCM module for Titanium.
License: MIT License
GCM/FCM module for Titanium.
License: MIT License
Can you elaborate the following implementation:
Is the alert
property meant to be the body
property as seen here:
https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support
I'm confused why it is required. Can you put something in the docs for this or clarify here?
[DEBUG] : D/ti.goosh.TiGooshModule: No notification in Intent
[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[WARN] : GooglePlayServicesUtil: Google Play services out of date. Requires 8487000 but found 7895032
[WARN] : W/System.err: java.lang.NoClassDefFoundError: com.google.android.gms.R$string
[WARN] : W/System.err: at com.google.android.gms.common.internal.zzg.zzc(Unknown Source)
[WARN] : W/System.err: at com.google.android.gms.common.GooglePlayServicesUtil.zza(Unknown Source)
[WARN] : W/System.err: at com.google.android.gms.common.GooglePlayServicesUtil.getErrorDialog(Unknown Source)
[WARN] : W/System.err: at com.google.android.gms.common.GooglePlayServicesUtil.getErrorDialog(Unknown Source)
[WARN] : W/System.err: at com.google.android.gms.common.GoogleApiAvailability.getErrorDialog(Unknown Source)
[WARN] : W/System.err: at ti.goosh.TiGooshModule.checkPlayServices(TiGooshModule.java:89)
[WARN] : W/System.err: at ti.goosh.TiGooshModule.registerForPushNotifications(TiGooshModule.java:114)
[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:177)
[WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:319)
[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:203)
Hi
When i send a push with firebase console, i get an nullpointer exception:
[INFO] : I/ti.goosh.IntentService: Not showing notification cause missing data.alert
[ERROR] : TiApplication: (AsyncTask #1) [15040,15040] Sending event: exception on thread: AsyncTask #1 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.gson.JsonObject.has(java.lang.String)' on a null object reference; Titanium 6.0.1,2016/12/19 16:51,undefined
[ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.gson.JsonObject.has(java.lang.String)' on a null object reference
[ERROR] : TiApplication: at ti.goosh.IntentService.parseNotification(IntentService.java:122)
[ERROR] : TiApplication: at ti.goosh.IntentService.onMessageReceived(IntentService.java:54)
[ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
[ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
[ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
[ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
[ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
[ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
[ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
[ERROR] : TiApplication: at java.lang.Thread.run(Thread.java:761)
any idea how i could work it out?
In firebase console I tried using the basic message as well as the advanced options adding key/value but with same outcome.
I'm using v.2.0 of the module.
In the payload, you can specify additionally:
Key | Type | Description | Example |
---|---|---|---|
vibrate | Array | Set the vibration pattern to use. | [100,200,0,100,200...] |
lights | String | Set the argb value that you would like the LED on the device to blnk, as well as the rate | [ "#FF00FF", 200, 100 ] |
ongoing | Boolean | Set whether this is an ongoing notification. | true |
group | String | Set this notification to be part of a group of notifications sharing the same key. | 'groupA' |
when | Number | Set the time that the event occurred. Notifications in the panel are sorted by this time. | 1470058413 |
only_alert_once | Boolean | Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing. | true |
Docs: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
Be careful that:
vibrate
is already a param Boolean. We should check its implicit type.Implement the new Firebase Cloud Messaging
I try to unregister push notifications, when I call TiGoosh.unregisterForPushNotifications()
I get the following crash:
FATAL EXCEPTION: AsyncTask #2
Process: com.xxx.yyy, PID: 8258
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodError: No virtual method deleteToken(Ljava/lang/String;Ljava/lang/String;)V in class Lcom/google/android/gms/iid/InstanceID; or its super classes (declaration of 'com.google.android.gms.iid.InstanceID' appears in /data/app/com.xxx.yyy-1/base.apk)
at ti.goosh.TiGooshModule$1.doInBackground(TiGooshModule.java:148)
at ti.goosh.TiGooshModule$1.doInBackground(TiGooshModule.java:144)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more
Im using supplied Google Play Services JARs (gps-jars/google-play-services-gcm+maps.jar
)
I tink the root of the issue is in proguard confs (eg. gps-jars/gcm+maps.conf
), they should also keep com.google.android.gms.iid.InstanceID
calss?
How can I cancel a notification?
I need because the user can not click on the notification and open the application to see the contents.
When my app is completely closed and I click the notification, I get the "No valid root or current activity found for application instance"
Im using ti.goosh 2.0.6 and TiSDK 6.0.4. I have also tried to compile my app using TiSDK 6.0.1, but still getting the same error.
There is similar (closed) issue #47 but with no actual solution, other than using TiSDK 6.0.4?
How do i subscribe for a topic !
Thanks,
TiGoosh.unregisterForPushNotifications();
Hello,
I got this error :
[ERROR] : TiExceptionHandler: (main) [718,718] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,718] - In app.js:14,9
[ERROR] : TiExceptionHandler: (main) [0,718] - Message: Uncaught Error: Failed resolution of: Lcom/google/android/gms/R$string;
[ERROR] : TiExceptionHandler: (main) [0,718] - Source: TiGoosh.registerForPushNotifications({
[ERROR] : V8Exception: Exception occurred at app.js:14: Uncaught Error: Failed resolution of: Lcom/google/android/gms/R$string;
Titanium 5.3.0 GA
I installed module from help/install mobile module with ti.goosh-android-1.0.1.zip file.
I used the code sample in example folder in module, What I did wrong please ?
Thanks in advance.
Hi,
The FCM works fine when the app is in foreground and a push comes, but when the app is in background and the system tray notification is clicked , it just opens up the app without passing any intent extras.
Today... with no changes in my code i am receiving this every time i want to send a push:
stdClass Object ( [multicast_id] => 5448133919056867326 [success] => 0 [failure] => 1 [canonical_ids] => 0 [results] => Array ( [0] => stdClass Object ( [error] => MissingRegistration ) ) )
The code i use to send the push is:
You can check the line 57 and 58, i've try those lines too with no success.
Is there something new i have to change in my app ?
i am using TiGoosh 2.0.5 and Titanium SDK 6.0.3
Thanks in advance..
Hello,
I am currently using as Push Notifications service to service Pushbots, where unfortunately there is no support for Appcelerator.
Create a function that makes the record via its API on my device when using TiGoosh for Token generation.
However, the listener at least TIGoosh using this service (Pushbots) does not work.
I'm combining bad services? Or something is wrong? Any support will be very useful.
Greetings from Mexico
02-21 10:57:19.413: E/AndroidRuntime(28868): FATAL EXCEPTION: AsyncTask #4
02-21 10:57:19.413: E/AndroidRuntime(28868): Process: com.mytitaniumapp, PID: 28868
02-21 10:57:19.413: E/AndroidRuntime(28868): java.lang.NullPointerException: Attempt to invoke virtual method 'void ti.goosh.TiGooshModule.sendMessage(java.lang.String, java.lang.Boolean)' on a null object reference
02-21 10:57:19.413: E/AndroidRuntime(28868): at ti.goosh.IntentService.parseNotification(IntentService.java:130)
02-21 10:57:19.413: E/AndroidRuntime(28868): at ti.goosh.IntentService.onMessageReceived(IntentService.java:54)
02-21 10:57:19.413: E/AndroidRuntime(28868): at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
02-21 10:57:19.413: E/AndroidRuntime(28868): at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
02-21 10:57:19.413: E/AndroidRuntime(28868): at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
02-21 10:57:19.413: E/AndroidRuntime(28868): at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
02-21 10:57:19.413: E/AndroidRuntime(28868): at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
02-21 10:57:19.413: E/AndroidRuntime(28868): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
02-21 10:57:19.413: E/AndroidRuntime(28868): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
02-21 10:57:19.413: E/AndroidRuntime(28868): at java.lang.Thread.run(Thread.java:818)
Any clue on why the above error happens? This module seems quite unstable at times. Am I missing some manifest rules? I'm testing a few situations here:
Platform: Sony Xperia Z3 Compact, Android 6.0.1
I know there where reports before, but are marked as closed and I'm still experiencing the same issue
when my app is in the background and receives a notification it shows properly and i get this log
[DEBUG] D/ti.goosh.IntentService: Push notification received from: 545132955493
[DEBUG] D/ti.goosh.IntentService: Notification key : google.sent_time => 1490879315641 (java.lang.Long)
[DEBUG] D/ti.goosh.IntentService: Notification key : data => {"alert":"Qwer","sound":"default","chatRoomId":"db08cfbe-ec47-4d31-8bd4-f4e308180a6b","force_show_in_foreground":true,"vibrate":true,"chatRoomName":"Ivan Sarpi","title":"Ivan Sarpi"} (java.lang.String)
[DEBUG] D/ti.goosh.IntentService: Notification key : title => Ivan Sarpi (java.lang.String)
[DEBUG] D/ti.goosh.IntentService: Notification key : google.message_id => 0:1490879315646921%%bbb352d4f9fd7ecd (java.lang.String)
[DEBUG] D/ti.goosh.IntentService: Notification key : message => Qwer (java.lang.String)
when i click that notification i get this
[DEBUG] D/ti.goosh.TiGooshPushHandlerActivity: started
[DEBUG] [TiPush]: {"inBackground":true,"data":"{\"alert\":\"Qwer\",\"sound\":\"default\",\"chatRoomId\":\"db08cfbe-ec47-4d31-8bd4-f4e308180a6b\",\"force_show_in_foreground\":true,\"vibrate\":true,\"chatRoomName\":\"Ivan Sarpi\",\"title\":\"Ivan Sarpi\"}"}
[INFO] {"alert":"Qwer","sound":"default","chatRoomId":"db08cfbe-ec47-4d31-8bd4-f4e308180a6b","force_show_in_foreground":true,"vibrate":true,"chatRoomName":"Ivan Sarpi","title":"Ivan Sarpi"}
and it does what it's suppose to do (open a new window)
now, when the app is closed, i get this log when the notification arrives (it shows properly)
[DEBUG] D/ti.goosh.IntentService: Push notification received from: 545132955493
[DEBUG] D/ti.goosh.IntentService: Notification key : google.sent_time => 1490879747307 (java.lang.Long)
[DEBUG] D/ti.goosh.IntentService: Notification key : data => {"alert":"Sfdac","sound":"default","chatRoomId":"db08cfbe-ec47-4d31-8bd4-f4e308180a6b","force_show_in_foreground":true,"vibrate":true,"chatRoomName":"Ivan Sarpi","title":"Ivan Sarpi"} (java.lang.String)
[DEBUG] D/ti.goosh.IntentService: Notification key : title => Ivan Sarpi (java.lang.String)
[DEBUG] D/ti.goosh.IntentService: Notification key : google.message_id => 0:1490879747312886%%bbb352d4f9fd7ecd (java.lang.String)
[DEBUG] D/ti.goosh.IntentService: Notification key : message => Sfdac (java.lang.String)
but when i click it, it only opens the app and doesn't open the new window, it says this in the logs
[DEBUG] D/ti.goosh.TiGooshPushHandlerActivity: started
[ERROR] TiApplication: (main) [45015,45015] No valid root or current activity found for application instance
[INFO] TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO] TiApplication: (main) [1,1] Analytics have been disabled
[WARN] V8Object: (KrollRuntimeThread) [235,236] Runtime disposed, cannot set property 'userAgent'
[WARN] TiApplication: (KrollRuntimeThread) [5,241] Registering module with name already in use.
[INFO] TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.ubqti.mega.UbqtiMegaActivity@7aeb756
[DEBUG] Window: Checkpoint: postWindowCreated()
[WARN] TiApplication: (KrollRuntimeThread) [115,115] Registering module with name already in use.
[DEBUG] D/ti.goosh.TiGooshModule: No notification in Intent
I'm using titanium 6.0.3.GA
and ti.goosh 2.0.5
thanks!
edit:
also, could it be related to this i have in my manifest?
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:versionCode="1" android:versionName="1.00">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<application android:hardwareAccelerated="true" android:theme="@style/Light">
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<activity
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:name=".UbqtiMegaActivity"
android:theme="@style/Theme.Titanium">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="ubqtimega"/>
</intent-filter>
</activity>
</application>
</manifest>
</android>
Hi.
When sending a notification from the server console appcelerator answer me this: [ERROR]: E / ti.goosh.TiGooshModule: sendMessage Invoked messageCallback but not defined
A This message is?
Thank you
I try to set custom notificationicon.png
, as described on readme. My icon file is in app\platform\android\res\drawable-*\notificationicon.png
folders (mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi).
When my app receives notifications, devices displays app icon as notification icon (which is default/fallback icon).
I have also tried to use the icon provided by ti.goosh (removed my own icon, so the icons comes from module), but with same result.
When I build my app, titanium packs notificationicon.png
to drawable-*-v4
folder, which should not be the issue?
Im using TiSDK 6.0.4.GA
We've gotten support tickets on crashes related to push notifications but the only one we've seen ourselves is on Android 4.x devices where the app is completely shut down and then crashes when opening an push notification.
From the log on Play Store I get these two errors regarding goosh:
This one comes from Android 5.x - 7.x
java.lang.NullPointerException: Attempt to invoke virtual method 'void ti.goosh.TiGooshModule.sendMessage(java.lang.String, java.lang.Boolean)' on a null object reference
at ti.goosh.IntentService.parseNotification(IntentService.java:130)
at ti.goosh.IntentService.onMessageReceived(IntentService.java:54)
at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
This one comes from Android 4.4
java.lang.NullPointerException
at ti.goosh.IntentService.parseNotification(IntentService.java:130)
at ti.goosh.IntentService.onMessageReceived(IntentService.java:54)
at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Are these known bugs?
We're using ti.goosh 1.6.2 with Titanium SDK 5.5.1
If compile app with ti.ga and ti.goosh have error
java.util.zip.ZipException: duplicate entry: assets/README
please remove this file from module.
Title.
I plan to have a longer alert message and they cannot fully be shown
I have some issues with the usage pattern described below:
Have tested on several devices, with the same result.
Is this normal behaviour or am I missing something?
Play Store wants me to provide a privacy policy for my apps, because this module is requesting "android.permission.GET_ACCOUNTS".
Is that permission required, or could it be removed?
This is the exact message I get: "Your app has an apk with version code 21 that requests the following permission(s): android.permission.GET_ACCOUNTS. Apps using these permissions in an APK are required to have a privacy policy set". I also got an email telling me to comply within March, 15, or else.
I am facing the same issue as described here on JIRA:
Have you experienced the same issue, but somehow managed to find a solution?
Hello,
First of all I would like to thank you for great job you do!
Unfortunately I cannot compile app if I use ti.map (2.3.10) and ti.goosh (1.3.0) modules at the same time. If I compile application without ti.map OR ti.goosh no error occurs.
Please provide update or some information how I can fix this problem (I need to use both maps and notifications) in my app.
Here is the error:
Failed to run dexer:
[ERROR] :
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzd$zza$zza;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzg$zza;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzd;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzd$zza;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzg;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zze;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/playlog/internal/zza;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/playlog/internal/zzb;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/playlog/internal/zzd;
[ERROR] :
[ERROR] : UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] : java.lang.RuntimeException: Translation has been interrupted
[ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
[ERROR] : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
[ERROR] : at com.android.dx.command.dexer.Main.run(Main.java:277)
[ERROR] : at com.android.dx.command.dexer.Main.main(Main.java:245)
[ERROR] : at com.android.dx.command.Main.main(Main.java:106)
[ERROR] : Caused by: java.lang.InterruptedException: Too many errors
[ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
[ERROR] : ... 4 more
Regards
Finally got the module to run after a few hoops then when I tried to registerforpushnotifications I now get this error. Any ideas?
Ti.Goosh 2.0.6
Titanium 6.0.4
[ERROR] : TiExceptionHandler: (main) [204,206] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,206] - In /app.js:341,11
[ERROR] : TiExceptionHandler: (main) [0,206] - Message: Uncaught Failed resolution of: Lcom/google/android/gms/R$string;
[ERROR] : TiExceptionHandler: (main) [0,206] - Source: TiGoosh.registerForPushNotifications({
[ERROR] : V8Exception: Exception occurred at /app.js:341: Uncaught Failed resolution of: Lcom/google/android/gms/R$string;
[ERROR] : V8Exception: Failed resolution of: Lcom/google/android/gms/R$string;
Not sure if its relevant or related but incase it is, I also use Ti.GA and used the gps-jars folder fix which works and allows me to atleast launch the app with both modules enabled. But as soon as I try to registerforpush then this error pops up
Hello to all! First I want to thank you for this awesome module. It works better than ACS API and ArrowDB!
Second, I have a problem with a Android 6.0.0 device (Huawei P9) and:
Titanium SDK : 5.5.1
ti.goosh : 1.6.2
I send a push notification through FCM api:
$url = 'https://fcm.googleapis.com/fcm/send';
When the app is opened or in background, the notification are received as expected, but when I close the app (killed from multitasking window) and send a notification again, FCM return success: 1 (as expected) but the notification banner never appears in the phone.
Am I doing anything wrong? My app code is really easy, is the same as your example in the module :)
var TiGoosh = require('ti.goosh');
TiGoosh.registerForPushNotifications({
// The callback to invoke when a notification arrives.
callback: function(e) {
//var data = JSON.parse(e.data || '');
Ti.API.error(e);
},
// The callback invoked when you have the device token.
success: function(e) {
// Send the e.deviceToken variable to your PUSH server
Ti.API.error('Notifications: device token is ' + e.deviceToken);
},
// The callback invoked on some errors.
error: function(err) {
Ti.API.error('Notifications: Retrieve device token failed', err);
}
});
Thanks again for your awesome job!
Pau.
First off, outstanding job on this module. It seems to work really well for the most part, and I'm really excited to replace the old push notif module in my app with this.
I'm having one issue, as described in the title. In the documentation, the expected behavior for when the app is in the background is, "if the app is in background, the standard OS view for incoming notifications is shown. If you click on that banner, the callback is invoked with the notification payload + the property inBackground = true" That's exactly the behavior I would like, but it doesn't seem to be working.
If my app is in the background and a notification is received, callback is called right away rather than when the notification is tapped. However, if you completely close the app, then it works as expected (callback gets called with expected data right when the app starts).
Any help is greatly appreciated, thanks!
Well.. this is happening when i try to build the app in the device.
i just add the module in the titanium project with other code, just adding, compiling and bum!
[ERROR] : Failed to run dexer:
[ERROR] :
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/AccountPicker;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/ConnectionResult;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/ErrorDialogFragment;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GoogleApiAvailability;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesNotAvailableException;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesRepairableException;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesUtil;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesUtil$zza;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/Scopes;
[ERROR] :
[ERROR] : UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] : java.lang.RuntimeException: Translation has been interrupted
[ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
[ERROR] : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
[ERROR] : at com.android.dx.command.dexer.Main.run(Main.java:277)
[ERROR] : at com.android.dx.command.dexer.Main.main(Main.java:245)
[ERROR] : at com.android.dx.command.Main.main(Main.java:106)
[ERROR] : Caused by: java.lang.InterruptedException: Too many errors
[ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
[ERROR] : ... 4 more
if i remove the module, the app is created with no problem.
I am using classic development with SDK 5.5.1 GA, TiGoosh 1.6.2
Thanks in advance.
What route should enter to leave next default icon?
Hi I have this new error , compiling an app to a version of j5 samsung android 5.1.1
[ERROR] : E/ti.goosh.RegistrationIntentService: Failed to get GCM Registration Token:SERVICE_NOT_AVAILABLE
[ERROR] : Notifications: Retrieve device token failed [object Object]
Thanks!
As per title, when compiling my project with the appcelerator sdk 6.0.1 GA and 6.0.0 GA I encounter this error on the app startup
failed: dlopen failed: could not load library "libstlport_shared.so" needed by "libti.goosh.so"; caused by library "libstlport_shared.so" not found
Hello,
Due to Titanium + Android bug (or behaviour) regarding the multidex, if user would have an app using ti.goosh module with ti.map module then will have problems during compilation.
Solution suggested by @kopiro is to create stripped version of Google Play Services (https://medium.com/all-titanium/deal-with-titanium-modules-and-its-missing-support-for-android-multidex-546de5486d13).
Could you provide how is your proguard.conf file looking like (what are required classes), so any user could modify it to achieve simultaneously work of both modules?
Thanks in advance.
I´m not using additional modules and i get this error:
Could not find a valid Titanium module id=ti.goosh version=latest platform=android deploy-type=development.
[ERROR] : Could not find all required Titanium Modules:
[ERROR] : id: ti.goosh version: latest platform: android deploy-type: development
<modules>
<module platform="android">ti.goosh</module>
</modules>
I installed the module using gittio and is located under modules/android/ti.goosh
Any ideas?
Thank you!
The app is calling the callback function only if is on foreground. When the app is closed and I click on the notification, the app open, but not execute callback function.
Hi, I have an issue.
When I press Home button to view phone's home screen. Click on notification > app open detail page.
But when I close app > click notification > only open app, not open detail page.
Can you please help on this?
Using the latest version (1.6.2), I've had an issue reported from some users. It doesn't happen a all the time, but it has been happening fairly frequently. Sometimes when the app is opened from a notif, it goes directly to a blank, all-black screen. But if you hit the system back button, it goes to the correct screen showing the correct content. Any idea why that black screen might be coming up?
Hello,
I've successfully implemented this module to my app and I stumbled upon something. I've made a request, while the app is in foreground, to Google to send me a notification. This works and the app correctly tells me that inBackground is false. Now that I've added the force_show_in_foreground: true
node to the same request it tells me that inBackground is true whilst it's not.
EDIT: I forgot to mention that this issue only appears when you click on the notification.
hi, I have a simple question
how can enable and edit the sound of the notification push ?
Any way to define the following line at runtime:
<property name="gcm.senderid">1118111711111</property>
The issue im having is that I want a separate environment for development devices vs production devices. Firebase doesnt seem to particularly support this, so the only way is to define 2 projects.
However, when registering APN tokens with FCM/GCM (see https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens), i am able to pass sandbox:true/false
which determines which Certificate (Apple developers config) GCM should use when sending to that Apple device.
So in my Firebase project I can seem to define a dev+prod environment for iOS, but for Android there is none.
Quick question on the remoteNotificationsEnabled
method.
On first app load when I get the token initially everything works great. The remoteNotificationsEnabled
code works and will return true if I accept it. Once I close the app, on initialization when I use that to check to see if I should request push or not I get:
[INFO] : TiGoosh.remoteNotificationsEnabled false
[INFO] : TiGoosh.remoteDeviceUUID dgpX***PJ22M
Because I'm getting the device token, shouldn't remoteNotificationsEnabled
be true? Looking over the source code it seems like it's only being set in the registerForPushNotifications
success and failure callbacks.
So the question is, is remoteNotificationsEnabled really only supposed to be used AFTER firing registerForPushNotifications
during that specific app load, and not between app loads?
Is it possible to create a method that verifies that 1) There is a DeviceUUID
AND they have enabled push notifications (something like https://developer.android.com/reference/android/support/v4/app/NotificationManagerCompat.html#areNotificationsEnabled()).
This is how I pushed it from REST Client
to : https://fcm.googleapis.com/fcm/send
Content-Type: application/json
Authorization:key=my_key
payload : { "data": {
"alert": "Testing",
"title": "This is title test",
"tag":"this is tag",
},
"to" : my_device_token
}
I received the notification on my phone, but my application crashed. This is the log
What is the problem? Thanks
I'm trying to replace our existing GCM module (the morinel module) with yours. Your module looks good, but I get occasional app crashes after a user taps a notification. And, I'm seeing errors in the console that I suppose might be related.
Scenario where this just happened:
I also see the following in the console logs, which may be a separate issue:
[ERROR] TiApplication: (AsyncTask #2) [191744,195672] Sending event: exception on thread: AsyncTask #2 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonPrimitive com.google.gson.JsonObject.getAsJsonPrimitive(java.lang.String)' on a null object reference; Titanium 5.2.2,2016/03/28 14:12,b685ddb
[ERROR] TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonPrimitive com.google.gson.JsonObject.getAsJsonPrimitive(java.lang.String)' on a null object reference
[ERROR] TiApplication: at ti.goosh.IntentService.parseNotification(IntentService.java:130)
[ERROR] TiApplication: at ti.goosh.IntentService.onMessageReceived(IntentService.java:47)
[ERROR] TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
[ERROR] TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
[ERROR] TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
[ERROR] TiApplication: at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
[ERROR] TiApplication: at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
[ERROR] TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
[ERROR] TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
[ERROR] TiApplication: at java.lang.Thread.run(Thread.java:818)
[ERROR] AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
[ERROR] AndroidRuntime: Process: com.acvauctions.demo, PID: 27557
[ERROR] AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonPrimitive com.google.gson.JsonObject.getAsJsonPrimitive(java.lang.String)' on a null object reference
[ERROR] AndroidRuntime: at ti.goosh.IntentService.parseNotification(IntentService.java:130)
[ERROR] AndroidRuntime: at ti.goosh.IntentService.onMessageReceived(IntentService.java:47)
[ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
[ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
[ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
[ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
[ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
[ERROR] AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
[ERROR] AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
[ERROR] AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
[INFO] Process: Sending signal. PID: 27557 SIG: 9
Hi,
since FCM is "the future" I think we need a solution for this, so we can work with it :)
If i send a test notification over FCM my app crashes.
[ERROR] : TiApplication: (AsyncTask #3) [56387,57328] Sending event: exception on thread: AsyncTask #3 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.gson.JsonObject.has(java.lang.String)' on a null object reference; Titanium 6.0.1,2016/12/19 16:51,undefined [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.gson.JsonObject.has(java.lang.String)' on a null object reference [ERROR] : TiApplication: at ti.goosh.IntentService.parseNotification(IntentService.java:122) [ERROR] : TiApplication: at ti.goosh.IntentService.onMessageReceived(IntentService.java:54) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
Not sure how to set the "alert" object, since there is no such input on the fcm page. Just Keypairs. Any help would be great.
Hi, i'm trying to use Ti.Map and Ti.Goosh together. I followed step by step your procedure (this is a screenshot: http://s11.postimg.org/bhvi7dg8j/tre.png ), but i get this error during compile:
[ERROR] Failed to run dexer: [ERROR] [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/AccountPicker; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/ConnectionResult; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/ErrorDialogFragment; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GoogleApiAvailability; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesNotAvailableException; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesRepairableException; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesUtil; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/GooglePlayServicesUtil$zza; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/Scopes; [ERROR] [ERROR] UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] java.lang.RuntimeException: Translation has been interrupted [ERROR] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608) [ERROR] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311) [ERROR] at com.android.dx.command.dexer.Main.run(Main.java:277) [ERROR] at com.android.dx.command.dexer.Main.main(Main.java:245) [ERROR] at com.android.dx.command.Main.main(Main.java:106) [ERROR] Caused by: java.lang.InterruptedException: Too many errors [ERROR] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600) [ERROR] ... 4 more
my version.xml files are both:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="google_play_services_version">8487000</integer>
</resources>
I'm using Genymotion as emulator.
What i wrong?
Luca
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.