Giter Site home page Giter Site logo

hansemannn / titanium-firebase-cloud-messaging Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 31.0 28.25 MB

Use the Firebase Cloud Messaging SDK in Axway Titanium 🚀 Edit

License: Other

JavaScript 1.39% Objective-C 77.98% Java 20.63%
appcelerator axway firebase firebase-cloud-messaging javascript native titanium

titanium-firebase-cloud-messaging's People

Contributors

astrovic avatar fahad86 avatar gjerlow avatar hansemannn avatar jei avatar jordanbisato avatar lalitagertrudis avatar m1ga avatar roelandp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

titanium-firebase-cloud-messaging's Issues

No static method zzb

App crashes on boot. By wrong combination of libraries?

Titanium SDK 7.5.0.GA

ti.playservices 11.8.0
firebase.core 3.0.2
firebase.cloudmessaging 1.4.0

Error message:

FATAL EXCEPTION: main
    Process: my.test.app, PID: 15149
    java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzbo; or its super classes (declaration of 'com.google.android.gms.common.internal.zzbo' appears in /data/app/jp.ibaraki.namegata.city.namegatakosodate-yycIKM5Ekuefpm0Fb9gTWA==/base.apk:classes2.dex)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:2)
        at android.app.ActivityThread.installProvider(ActivityThread.java:7107)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:6594)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6498)
        at android.app.ActivityThread.-wrap2(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1963)
        at android.os.Handler.dispatchMessage(Handler.java:108)
        at android.os.Looper.loop(Looper.java:166)
        at android.app.ActivityThread.main(ActivityThread.java:7425)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

Android: One Plus 6 and Samsung phones showing notification tray

Hi @hansemannn, @m1ga

Push notification is working fine on stock android but on some phones it is not showing in notification tray.

When phone receives notification I get the following in the log.

GCM     : broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000000 pkg=bundle_id_here (has extras) }

When app is in foreground it is working fine on all phones.

Please help.
Thanks!

Error Building the cloudpush module on Ti SDK 6.3.0.GA.

Hi,

I have updated the manifest accordingly with the required changes to build package using TI SDK 6.3.0.GA.

But we are having following error while compiling.

rt/Titanium/mobilesdk/osx/6.3.0.GA/android/jaxen-1.1.1.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/json_simple-1.1.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/kroll-apt.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/kroll-common.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/kroll-v8.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/maps.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/nineoldandroids-appc-2.4.0.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/ti-commons-codec-1.3.jar:/Users/mindstixsoftwarelabs/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/android/titanium.jar:/Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/build/intermediates/exploded-aar/firebase-messaging-11.0.4/classes.jar" "-d" "/Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/build/classes" "-target" "1.6" "-g" "-source" "1.6" "@/Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/java-sources.txt" "-processor" "org.appcelerator.kroll.annotations.generator.KrollJSONGenerator" "-s" "/Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/build/generated/json" "-Akroll.jsonFile=titanium-firebase-cloud-messaging.json" "-Akroll.jsonPackage=org.appcelerator.titanium.bindings"
[ERROR] Failed to compile Java source files:
[ERROR]
[ERROR] warning: [options] bootstrap class path not set in conjunction with -source 1.6
[ERROR] /Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/src/firebase/cloudmessaging/TiFirebaseMessagingService.java:18: error: cannot access zzb
[ERROR] public class TiFirebaseMessagingService extends FirebaseMessagingService
[ERROR] ^
[ERROR] class file for com.google.firebase.iid.zzb not found
[ERROR] Note: [KrollBindingGen] Running Kroll binding generator.
[ERROR] Note: [KrollBindingGen] No binding data found, creating new data file: org.appcelerator.titanium.bindings/titanium-firebase-cloud-messaging.json
[ERROR] Note: [KrollBindingGen] Found binding for module CloudMessaging
[ERROR] /Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/src/firebase/cloudmessaging/CloudMessagingModule.java:18: error: package com.google.firebase.iid does not exist
[ERROR] import com.google.firebase.iid.FirebaseInstanceId;
[ERROR] ^
[ERROR] /Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/src/firebase/cloudmessaging/TiFirebaseInstanceIDService.java:4: error: package com.google.firebase.iid does not exist
[ERROR] import com.google.firebase.iid.FirebaseInstanceId;
[ERROR] ^
[ERROR] /Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/src/firebase/cloudmessaging/TiFirebaseInstanceIDService.java:5: error: package com.google.firebase.iid does not exist
[ERROR] import com.google.firebase.iid.FirebaseInstanceIdService;
[ERROR] ^
[ERROR] /Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/src/firebase/cloudmessaging/TiFirebaseInstanceIDService.java:7: error: cannot find symbol
[ERROR] public class TiFirebaseInstanceIDService extends FirebaseInstanceIdService
[ERROR] ^
[ERROR] symbol: class FirebaseInstanceIdService
[ERROR] Note: [KrollBindingGen] Generating JSON: file:/Users/mindstixsoftwarelabs/Downloads/titanium-firebase-cloud-messaging-master2/android/build/generated/json/org/appcelerator/titanium/bindings/titanium-firebase-cloud-messaging.json
[ERROR] 4 errors

Can you please help me out here!

Send image in push notification

I implemented this plugin in android and I am getting push notification in android. Now I want to send image along with push notification title and message, can you please let me know how to do this ? I tried sending image path through Key/Value pair in firebase console where image key was "image", "img_url" which I found through google but there was no success. Please help. Thank you.

Can't Build using 2.0.1

I am using Appc SDK 7.5.0. With Firebase core 2.0.0 and an older version of this module, everything works fine. ( As you can see I am using the newest firebase core ).

• When I try to build to a device I get an error about "DTDeviceKit: deviceType from 00008006-000668380CE2002E was NULL"

• When I try to build to a simulator I get errors about "Undefined symbols for architecture x86_64"

Error log for build against simulator:

[TRACE] Undefined symbols for architecture x86_64:
[TRACE] "OBJC_CLASS$_FIRComponentType", referenced from:
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessaging.o)
[TRACE] "OBJC_CLASS$_GULReachabilityChecker", referenced from:
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessaging.o)
[TRACE] "OBJC_CLASS$_FIRComponent", referenced from:
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessaging.o)
[TRACE] "OBJC_CLASS$_GULAppEnvironmentUtil", referenced from:
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessagingReceiver.o)
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessagingAnalytics.o)
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessagingUtilities.o)
[TRACE] "OBJC_CLASS$_FIRDependency", referenced from:
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessaging.o)
[TRACE] "OBJC_CLASS$_FIRComponentContainer", referenced from:
[TRACE] objc-class-ref in FirebaseMessaging(FIRMessaging.o)
[TRACE] ld: symbol(s) not found for architecture x86_64
[TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ERROR] ** BUILD FAILED **

Error log for build against device:

[TRACE] CompileC /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Objects-normal/arm64/TiUIiOSMenuPopupProxy.o /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/Classes/TiUIiOSMenuPopupProxy.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: Dealer Center)
[TRACE] cd /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone
[TRACE] export LANG=en_US.US-ASCII
[TRACE] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fmodules -gmodules -fmodules-cache-path=/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wunreachable-code -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wno-parentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEPLOYTYPE=development -DLAUNCHSCREEN_STORYBOARD=1 -DDEFAULT_BGCOLOR_RED=1 -DDEFAULT_BGCOLOR_GREEN=1 -DDEFAULT_BGCOLOR_BLUE=1 -DTI_LOG_SERVER_PORT=45296 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wno-strict-prototypes -Wno-semicolon-before-method-body -Wno-unguarded-availability -index-store-path /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/DerivedData/Index/DataStore -iquote /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Dealer\ Center-generated-files.hmap -I/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Dealer\ Center-own-target-headers.hmap -I/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Dealer\ Center-all-target-headers.hmap -iquote /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Dealer\ Center-project-headers.hmap -I/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Products/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/usr/include/libxml2 -Iheaders -I/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/DerivedSources/arm64 -I/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/DerivedSources -Wno-arc-performSelector-leaks -F/Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Products/Debug-iphoneos -F/Users/jason.wogan/Library/Application\ Support/Titanium/modules/iphone/firebase.core/2.0.0/platform -F/Users/jason.wogan/Library/Application\ Support/Titanium/modules/iphone/com.traderinteractive.appsee/0.0.1/platform -F/Users/jason.wogan/Library/Application\ Support/Titanium/modules/iphone/com.traderinteractive.fyusion/0.0.2/platform -F/Users/jason.wogan/Library/Application\ Support/Titanium/modules/iphone/firebase.cloudmessaging/2.0.1/platform -F/Users/jason.wogan/Library/Application\ Support/Titanium/modules/iphone/firebase.analytics/1.3.0/platform -F/Users/jason.wogan/Library/Application\ Support/Titanium/modules/iphone/ti.crashlytics/1.1.1/platform -DDEBUG -include /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/PrecompiledHeaders/SharedPrecompiledHeaders/11076202699044268272/Dealer_Center_Prefix.pch -MMD -MT dependencies -MF /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Objects-normal/arm64/TiUIiOSMenuPopupProxy.d --serialize-diagnostics /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Objects-normal/arm64/TiUIiOSMenuPopupProxy.dia -c /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/Classes/TiUIiOSMenuPopupProxy.m -o /Users/jason.wogan/work/mobileapps/mobile-imt-v2/build/iphone/build/Intermediates/Dealer\ Center.build/Debug-iphoneos/Dealer\ Center.build/Objects-normal/arm64/TiUIiOSMenuPopupProxy.o
[ERROR] 2018-11-26 15:54:12.250 xcodebuild[17594:1076757] DTDeviceKit: deviceType from 00008006-000668380CE2002E was NULL

Error on notification click

I receive notifications normally when the app is in background but when I click on them I get the following error:
TiLaunchActivity: (main) [16,187642] Android issue 2373 detected (missing intent CATEGORY_LAUNCHER or FLAG_ACTIVITY_RESET_TASK_IF_NEEDED), restarting app.
I even tried the modified version of the module from #31 but I had the same issue.
Here's the screen I get when the error occurs: https://ibb.co/XkjSvrm

PS: I looked everywhere before adding this issue.

Firebase Cloud Messaging 1.3.0 : Notifications not shown with SDK 26 and Oreo

Using Firebase Cloud Messaging 1.3.0 I receive the notification and "Message" log when I use android:targetSdkVersion="25" but with android:targetSdkVersion="26" I only receive the "Message" log and no notification appears

Tested using Android 8.0.0 (Huawei P8 lite 2017) and Android 8.1.0 (Google Pixel 2).

Only Android
Titanium SDK : 7.4.1.GA
Using Firebase Cloud Messaging 1.3.1 and Firebase Core 2.3.0

If I enable "Show notification channel warnings" in "Developer Options" I receive the following message:

Developer warning for package "com.xxx.firebasecloud"
Failed to post notification on channel "null"
See log for more details

After reading Creating an Android 8.0 Oreo app: Implementing Notification Channels I understand that :

f your app targets Android 8.0 then you must specify a notification channel every time you create a notification, by passing the channel’s ID to the Notification.Builder constructor

you can assign your notification to a channel using the setChannelId() method.

If your app ever attempts to post a notification without specifying a notification channel, then that notification won’t appear onscreen

I got it working when in the Notification Builder from TiFirebaseMessagingService.java I added builder.setChannelId(params.get("channelId"));

// Start building notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
int builder_defaults = 0;
builder.setContentIntent(contentIntent);
builder.setAutoCancel(true);
builder.setPriority(2);
builder.setContentTitle(params.get("title"));
builder.setContentText(params.get("message"));
builder.setTicker(params.get("ticker"));
builder.setChannelId(params.get("channelId"));

and when sending messages from my server I add "channelId" to data array

<?php $url = 'https://fcm.googleapis.com/fcm/send';

	$fields = array (
			'to' => "TOKEN_ID",
			// 'to' => "/topics/test",
			/* 'notification' => array (
			 		"title" => "TiFirebaseMessaging",
			 		"body" => "Message received 📱😂",
			 		"timestamp"=>date('Y-m-d G:i:s'),
			),*/
			'data' => array(
				"test1" => "value1",
				"test2" => "value2",
				"timestamp"=>date('Y-m-d G:i:s'),
				"title" => "title",
				"message" => "message",
				"big_text"=>"big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text ",
				"big_text_summary"=>"big_text_summary",
				"icon" => "http://via.placeholder.com/150x150",
				"image" => "http://via.placeholder.com/350x150",	// won't show the big_text
				"force_show_in_foreground"=> true,
				"color" => "#ff6600",
                                "channelId" => "MyChannel"
			)
	);

	$headers = array (
			'Authorization: key=API_KEY',
			'Content-Type: application/json'
	);

	$ch = curl_init ();
	curl_setopt ( $ch, CURLOPT_URL, $url );
	curl_setopt ( $ch, CURLOPT_POST, true );
	curl_setopt ( $ch, CURLOPT_HTTPHEADER, $headers );
	curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
	curl_setopt ( $ch, CURLOPT_POSTFIELDS, json_encode($fields));

	$result = curl_exec ( $ch );
	echo $result."\n";
	curl_close ( $ch );
?>

Sound not playing

We've a problem with the sound when we send the notification. Everything works as expected but the mp3/wav is not playing. When the app is running the custom sound plays but when the app is completely closed it just plays the default sound of the phone. Could you please help us?, how should it be done?

Thanks!

Android crashes because applicationID required

I somehow need a placeholder value for the applicationID property in order for Android not to throw an error:

var core = require('firebase.core');
core.configure({
  googleAppID: 'abc-def-ghi',
  GCMSenderID: '123890'
  applicationID: 'PLACEHOLDERVALUE'
});

Error:

[ERROR] TiExceptionHandler: (main) [3977,4239] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [1,4240] - In /push_notifications.js:85,22
[ERROR] TiExceptionHandler: (main) [0,4240] - Message: Uncaught Default FirebaseApp is not initialized in this process com.testapp. Make sure to call FirebaseApp.initializeApp(Context) first.
[ERROR] TiExceptionHandler: (main) [0,4240] - Source:             this.FCM.registerForPushNotifications();
[ERROR] V8Exception: Exception occurred at /push_notifications.js:85: Uncaught Default FirebaseApp is not initialized in this process com.testapp. Make sure to call FirebaseApp.initializeApp(Context) first.
[ERROR] V8Exception: Default FirebaseApp is not initialized in this process com.testapp. Make sure to call FirebaseApp.initializeApp(Context) first.

I am not sure why it is required, but FCM functions without it as I've just put a string placeholder.

Fix suggestion: do not make it required at all.

Feature suggestion: implement google-services.json (Android config file from Firebase) for the file configuration property. That solves any of these issues since you are required to pass the whole config file. I could easily write a parser for javascript, but that cannot go in the module.

App Name not showing up on notification

Hi,

I have been able to configure the notification through Localytics and Firebase and your

Setting the Notification Icon
did help a lot in setting the notification icon . But I am not able to include app name in the notifications in android when I trigger a message from localytics.

Your help will be really appreciated @hansemannn

More details on how to register the events.

We are willing to use this module, we make it work and start receiving notifications, but the issue was that both event listeners are not working or we are using them in a wrong manner due to lack of description

for example, we used the handler like that:

firebaseCloudMessaging.addEventListener("didReceiveMessage", function(e) {console.log(e);});

This handler was never triggered at all, the notification was received but with no handler.

Thanks for this great module, and your help on that is much appreciated

FCM-Token: undefined

I'm not getting an FCM token.
I've put in the correct GoogleService-Info.plist file and there are no errors.
I'm running the app on a real iPhone device.
Any idea why I wouldn't be getting a token?

iOS: subscribeToTopic(topic) not work

I can give fcm.fcmToken but fcm.subscribeToTopic('testTopic') not work with me, the device not subscribe in topic, i check with this :
https://iid.googleapis.com/iid/info/FCM_TOKEN?details=true

This is my code (iOS only) :

// Firebase
var core = require('firebase.core');
var fcm = require('firebase.cloudmessaging');

// Configure core module (required for all Firebase modules).
core.configure({
    file: 'GoogleService-Info.plist'
});

// Called when direct messages arrive. Note that these are different from push notifications.
fcm.addEventListener('didReceiveMessage', function(e) {
    Ti.UI.createAlertDialog({
		message: e.message,
		ok: L('ok')
	}).show();
});

Ti.App.iOS.addEventListener('usernotificationsettings', function eventUserNotificationSettings() {
    // Remove the event again to prevent duplicate calls through the Firebase API
    Ti.App.iOS.removeEventListener('usernotificationsettings', eventUserNotificationSettings);

    // Register for push notifications
    Ti.Network.registerForPushNotifications({
        success: function () {},
        error: function () {},
        // Fired for all kind of notifications (foreground, background & closed)
        callback: function (e) {  		
        		var data = e.data;
	        	Ti.UI.createAlertDialog({
				message: data.aps.alert.body,
				title: data.aps.alert.title,
				ok: L('ok')
			}).show();
    		}
    });
});

// Register for the notification settings event
Ti.App.iOS.registerUserNotificationSettings({
    types: [
        Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT,
        Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND,
        Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE
    ]
});

// Register the device with the FCM service.
fcm.registerForPushNotifications();

// Check if token is already available.
if (fcm.fcmToken)
    Ti.API.info('FCM-Token', fcm.fcmToken);
else
    Ti.API.info('Token is empty. Waiting for the token callback ...');

// Subscribe to topic
fcm.subscribeToTopic('testTopic');

Versions:

  • firebase.core: 2.2.0
  • firebase.cloudmessaging: 2.0.1

Android Version

Any idea when the Android version will be available? Or suggestions for an alternative module that will work with SDK 7.x ?

API disparity between iOS and Android

in iOS we have the following methods:

- (void)subscribeToTopic:(id)topic

- (void)unsubscribeFromTopic:(id)topic

while in Android:

public void subcribeToTopic(String topic)

public void unsubcribeFromTopic(String topic)

Notification Tray Slow Response When App Closed on Android

If the app is not running on Android and a notification comes in the user can then tap on the notification tray to open the app. The app will then take approximately 5 to 6 seconds before it opens. If the app was minimized and the user taps on the notification tray then the app will open immediately.

App closed, how to get the data?

Hi,

if my app is closed and a push message with data fields arrive... How to get the data on tap the notification?

lastData seems to be empty

Display of Android Background notification with Data (node) only payload

Need more documentation on how to display (and customize) notifications with data node only, e.g.:
'data' => array(
"test1" => "value1",
"test2" => "value2",
"timestamp"=>date('Y-m-d G:i:s'),
"title" => "title",
"message" => "message",
"big_text"=>"big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text ",
"big_text_summary"=>"big_text_summary",
"icon" => "http://via.placeholder.com/150x150",
"image" => "http://via.placeholder.com/350x150", // won't show the big_text
"force_show_in_foreground"=> true,
"color" => "#ff6600"
)

Right now when the app is in the background, with the above payload being sent, we only get a toast message saying "message"

"force_show_in_foreground" not working

This is my payload structure to send the notification with nodejs:

{"payload":{"apns":{"payload":{"aps":{"alert":{"title":"Usuário pedindo guincho","body":"Abra o app para verificar"}}}},"android":{"data":{"force_show_in_foreground":"true"},"restricted_package_name":"br.com.skappguincho","priority":"HIGH","ttl":5000,"notification":{"title":"Usuário pedindo guincho","body":"Abra o app para verificar"}}}}

I indeed receive that flag on my app but it doesn't display the notification alert.

{"type":"didReceiveMessage","source":{"fcmToken":"emPMoJjEM4w:APA91bFGQ8VjL-OoUjKA8ol4maDGc7k_ehlHbcdt6Fc_1rc5mDE0mQhSP2Dr16kYnkcf6f97MPd-xrvqei4dlP5ft-8NJRG-Za0nYaA6x5wwftg2mKOLuKJVtyCyBP7WNtsGdMxc3r7z","lastData":{},"apiName":"Ti.Module","bubbleParent":true,"invocationAPIs":[],"_events":{"didRefreshRegistrationToken":{},"didReceiveMessage":{}}},"message":{"messageType":null,"title":"Usuário pedindo guincho","data":{"force_show_in_foreground":"true"},"to":null,"body":"Abra o app para verificar","sendTime":1551799625053,"from":"820353491234","messageId":"0:1551799625059099%a22bf179a22bf179","ttl":5},"bubbles":false,"cancelBubble":false}

I'm using 1.4.0
TiSDK 7.5.1.GA

Build with ti.playservices 16.1.2 causes ClassNotFoundExcepion

Compiling with the latest default version of ti.playservices the following error occurs:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbo;

It is necessary to specify the previous version 11.0.40 of the module

<module platform="android" version="11.0.40">ti.playservices</module> 

Support to have parity with onesignal payload - alert field for the subtitle of a push notification

Hello @m1ga @hansemannn . Good afternoon / evening.

I had to migrate from onesignal module to this module, you know for the reason of support, and new migration to firebase.

I noticed when onesignal sends to push notification from its web manager, the push notification is just displaying the title, and the subtitle of the push notification is not appearing, this behavior is due to the following:

Example of payload sent by onesignal
03-05 16: 06: 43.725 2206-2834 /? D / FirebaseMsgService: Data message: {custom = {"i": "5fbbf372-6d41-447a-9dab-1186168911a1"}, oth_chnl =, pri = 5, vis = 1, alert = desc, title = title, grp_msg =}

So, currently the module of TiFirebase can catchs the title field, and body field to display the title, and subtitle of a push notification, but as you can see in the above payload onesignal is sending the alert field for the description which the modue can not catch this part because is waiting the field of body.
(https://github.com/hansemannn/titanium-firebase-cloud-messaging/blob/master/android/src/firebase/cloudmessaging/TiFirebaseMessagingService.java#L64)

I noticed that the module is using an aar file (https://github.com/hansemannn/titanium-firebase-cloud-messaging/tree/master/android/lib/firebase-messaging-11.0.4.aar
), so I unzipped the file modifying the extension, so that I can get the files, and I noticed that there is a class.jar file, which it has all the clases, but I could not modify the specific classes inside of the .jar file, so that we can implement the change to display the subtitle of the push notification getting the alert field from onesignal, since the logic of the module it says that the module will get the body field from the payload for the subtitle.

My question is whether it could exist the possibility to have the classes from the jar file, so that we can edit/add this specific field (alert) with the setter/getter so that if someone is sending push notifications through one signal portal or api; the subtitle can be appearing.

Please let me know if you have any doubt or question.

Thanks, and best,
Antonio

compilation Error after adding this module

Hi There,

I wanted to integrate the Firebase in our application, But whenever we add this module and try to run the app on the simulator we are facing the compilation error. We are trying to find some solution on it.
Can you please help us on this?

Please find the logs from the Console.
Appcelerator Studio version 5.0.0
Ti SDK: 6.3.0GA
Appc CLI: 6.3.0
Xcode: 9.0.1

Logs from the console while compiling the App:

[TRACE] : 1 warning generated.
[TRACE] :
[TRACE] : CompileC build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiViewTemplate.o Classes/TiViewTemplate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[TRACE] : cd /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone
[TRACE] : export LANG=en_US.US-ASCII
[TRACE] : export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/bin:/bin:/Users/mindstixsoftwarelabs/Library/apache-ant-1.9.7/bin:/Users/mindstixsoftwarelabs/Library/android-ndk-r13b:/Users/mindstixsoftwarelabs/Documents/Android/home:/Users/mindstixsoftwarelabs/Documents/Android/home/platform-tools"
[TRACE] : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fmodules -gmodules -fmodules-cache-path=/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/DerivedData/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wunreachable-code -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wno-parentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEPLOYTYPE=development -DDEBUG=1 -DTI_VERSION=6.3.0 -DTI_LOG_SERVER_PORT=26848 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=8.0 -g -Wno-sign-conversion -Winfinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-unguarded-availability -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/DerivedData/Index/DataStore -iquote /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-generated-files.hmap -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-own-target-headers.hmap -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-all-target-headers.hmap -iquote /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-project-headers.hmap -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Products/Debug-iphonesimulator/include -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/libxml2 -Iheaders -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/DerivedSources/x86_64 -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/DerivedSources -Wno-arc-performSelector-leaks -F/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Products/Debug-iphonesimulator -F/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/modules/iphone/firebase.cloudmessaging/1.0.0/platform -DDEBUG -include /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/PrecompiledHeaders/Connect_Prefix-dkdfaqnxtwplsbanuxcthjysqgdn/Connect_Prefix.pch -MMD -MT dependencies -MF /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiViewTemplate.d --serialize-diagnostics /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiViewTemplate.dia -c /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/Classes/TiViewTemplate.m -o /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiViewTemplate.o
[TRACE] :
[TRACE] : CompileC build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiSelectedCellbackgroundView.o Classes/TiSelectedCellbackgroundView.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[TRACE] : cd /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone
[TRACE] : export LANG=en_US.US-ASCII
[TRACE] : export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/bin:/bin:/Users/mindstixsoftwarelabs/Library/apache-ant-1.9.7/bin:/Users/mindstixsoftwarelabs/Library/android-ndk-r13b:/Users/mindstixsoftwarelabs/Documents/Android/home:/Users/mindstixsoftwarelabs/Documents/Android/home/platform-tools"
[TRACE] : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fmodules -gmodules -fmodules-cache-path=/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/DerivedData/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wunreachable-code -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wno-parentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEPLOYTYPE=development -DDEBUG=1 -DTI_VERSION=6.3.0 -DTI_LOG_SERVER_PORT=26848 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=8.0 -g -Wno-sign-conversion -Winfinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-unguarded-availability -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/DerivedData/Index/DataStore -iquote /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-generated-files.hmap -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-own-target-headers.hmap -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-all-target-headers.hmap -iquote /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect-project-headers.hmap -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Products/Debug-iphonesimulator/include -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/libxml2 -Iheaders -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/DerivedSources/x86_64 -I/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/DerivedSources -Wno-arc-performSelector-leaks -F/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Products/Debug-iphonesimulator -F/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/modules/iphone/firebase.cloudmessaging/1.0.0/platform -DDEBUG -include /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/PrecompiledHeaders/Connect_Prefix-dkdfaqnxtwplsbanuxcthjysqgdn/Connect_Prefix.pch -MMD -MT dependencies -MF /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiSelectedCellbackgroundView.d --serialize-diagnostics /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiSelectedCellbackgroundView.dia -c /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/Classes/TiSelectedCellbackgroundView.m -o /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/TiSelectedCellbackgroundView.o
[TRACE] :
[TRACE] : Ld build/Products/Debug-iphonesimulator/Connect.app/Connect normal x86_64
[TRACE] : cd /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone
[TRACE] : export IPHONEOS_DEPLOYMENT_TARGET=8.0
[TRACE] : export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/bin:/bin:/Users/mindstixsoftwarelabs/Library/apache-ant-1.9.7/bin:/Users/mindstixsoftwarelabs/Library/android-ndk-r13b:/Users/mindstixsoftwarelabs/Documents/Android/home:/Users/mindstixsoftwarelabs/Documents/Android/home/platform-tools"
[TRACE] : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -L/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Products/Debug-iphonesimulator -L/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/lib -L/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/Classes/APSAnalytics -L/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/Classes/APSHTTPClient -L/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/modules/iphone/firebase.cloudmessaging/1.0.0 -F/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Products/Debug-iphonesimulator -F/Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/modules/iphone/firebase.cloudmessaging/1.0.0/platform -filelist /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/Connect.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/Connect_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -stdlib=libc++ -ObjC -weak-lti_ios_profiler -weak-lti_ios_debugger -weak-lTiCore -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Connect.app.xcent -weak_framework iAd -framework CoreMedia -weak_framework CoreMotion -lAPSAnalytics -weak_framework CoreText -framework EventKit -framework EventKitUI -weak_framework Security -licucore -framework Foundation -weak_framework UIKit -framework CoreGraphics -weak_framework AddressBook -framework AddressBookUI -framework CFNetwork -framework CoreLocation -weak_framework MapKit -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -lsqlite3 -lz -framework AudioToolbox -weak_framework MediaPlayer -framework AVFoundation -lxml2 -lAPSHTTPClient -ltiverify -lfirebase.cloudmessaging -framework FirebaseMessaging -Xlinker -dependency_info -Xlinker /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Intermediates/Connect.build/Debug-iphonesimulator/Connect.build/Objects-normal/x86_64/Connect_dependency_info.dat -o /Users/mindstixsoftwarelabs/Perforce/mobile/directAccess/DEV/directAccess-client-6-Dec-17/build/iphone/build/Products/Debug-iphonesimulator/Connect.app/Connect
[TRACE] : Undefined symbols for architecture x86_64:
[TRACE] : "OBJC_CLASS$_FIRApp", referenced from:
[TRACE] : objc-class-ref in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kServiceInfoFileName", referenced from:
[TRACE] : -[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kServiceInfoFileType", referenced from:
[TRACE] : -[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kFIRServiceMessaging", referenced from:
[TRACE] : -[FIRMessaging(FIRApp) configureMessaging:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : -[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kFIRAppIsDefaultAppKey", referenced from:
[TRACE] : +[FIRMessaging(FIRApp) didReceiveConfigureSDKNotification:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kFIRAppNameKey", referenced from:
[TRACE] : +[FIRMessaging(FIRApp) didReceiveConfigureSDKNotification:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kFIRAppReadyToConfigureSDKNotification", referenced from:
[TRACE] : +[FIRMessaging(FIRApp) load] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kFirebaseCloudMessagingErrorDomain", referenced from:
[TRACE] : -[FIRMessaging(FIRApp) configureMessaging:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : -[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_8f9050f0e621fdb8f1533f65d199228a.o)
[TRACE] : "_kFIRLoggerMessaging", referenced from:
[TRACE] : -[FIRMessagingLogger logFuncDebug:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncInfo:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncNotice:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncWarning:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncError:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : "_FIRLogBasic", referenced from:
[TRACE] : -[FIRMessagingLogger logFuncDebug:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncInfo:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncNotice:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncWarning:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : -[FIRMessagingLogger logFuncError:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_a242d038850ad1a0d85b3f9a968a56e0.o)
[TRACE] : "_GPBCheckRuntimeVersionSupport", referenced from:
[TRACE] : _GtalkGtalkCoreRoot_FileDescriptor in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : _GtalkGtalkExtensionsRoot_FileDescriptor in FirebaseMessaging(GtalkExtensions.pbobjc_1632ea94ae068a4c7353857994e00f47.o)
[TRACE] : "OBJC_CLASS$_GPBDescriptor", referenced from:
[TRACE] : objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc_1632ea94ae068a4c7353857994e00f47.o)
[TRACE] : "OBJC_CLASS$_GPBCodedOutputStream", referenced from:
[TRACE] : objc-class-ref in FirebaseMessaging(FIRMessagingSecureSocket_9e01de98511ffd1325313fe146c4cf7e.o)
[TRACE] : "OBJC_CLASS$_GPBFileDescriptor", referenced from:
[TRACE] : objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc_1632ea94ae068a4c7353857994e00f47.o)
[TRACE] : "OBJC_METACLASS$_GPBMessage", referenced from:
[TRACE] : OBJC_METACLASS$_GtalkHeartbeatPing in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_METACLASS$_GtalkHeartbeatAck in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_METACLASS$_GtalkErrorInfo in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_METACLASS$_GtalkSetting in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_METACLASS$_GtalkHeartbeatStat in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_METACLASS$_GtalkHeartbeatConfig in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_METACLASS$_GtalkLoginRequest in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : ...
[TRACE] : "OBJC_CLASS$_GPBEnumDescriptor", referenced from:
[TRACE] : objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc_1632ea94ae068a4c7353857994e00f47.o)
[TRACE] : "OBJC_CLASS$_GPBMessage", referenced from:
[TRACE] : OBJC_CLASS$_GtalkHeartbeatPing in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_CLASS$_GtalkHeartbeatAck in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_CLASS$_GtalkErrorInfo in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_CLASS$_GtalkSetting in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_CLASS$_GtalkHeartbeatStat in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_CLASS$_GtalkHeartbeatConfig in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_CLASS$_GtalkLoginRequest in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : ...
[TRACE] : "OBJC_CLASS$_GPBRootObject", referenced from:
[TRACE] : OBJC_CLASS$_GtalkGtalkCoreRoot in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_CLASS$_GtalkGtalkExtensionsRoot in FirebaseMessaging(GtalkExtensions.pbobjc_1632ea94ae068a4c7353857994e00f47.o)
[TRACE] : "OBJC_METACLASS$_GPBRootObject", referenced from:
[TRACE] : OBJC_METACLASS$_GtalkGtalkCoreRoot in FirebaseMessaging(GtalkCore.pbobjc_613b96508ff7f911bb0e8135aace76f5.o)
[TRACE] : OBJC_METACLASS$_GtalkGtalkExtensionsRoot in FirebaseMessaging(GtalkExtensions.pbobjc_1632ea94ae068a4c7353857994e00f47.o)
[TRACE] : "OBJC_CLASS$_FIRReachabilityChecker", referenced from:
[TRACE] : objc-class-ref in FirebaseMessaging(FIRMessaging_525e41c3f6cf74170293c90cab286e83.o)
[TRACE] : ld: symbol(s) not found for architecture x86_64
[TRACE] : clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ERROR] : 2018-03-03 00:25:31.018 xcodebuild[5150:46080] WARNING: Failed to load plugin at path: "/Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin", skipping. Error: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment): no suitable image found. Did find:
[ERROR] : /Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment: code signing blocked mmap() of '/Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment'
[ERROR] : /Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment: stat() failed with errno=1" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment, NSDebugDescription=dlopen_preflight(/Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment): no suitable image found. Did find:
[ERROR] : /Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment: code signing blocked mmap() of '/Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment'
[ERROR] : /Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin/Contents/MacOS/CComment: stat() failed with errno=1, NSBundlePath=/Users/mindstixsoftwarelabs/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CComment.xcplugin, NSLocalizedDescription=The bundle “CComment” couldn’t be loaded because it is damaged or missing necessary resources.}
[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld build/Products/Debug-iphonesimulator/Connect.app/Connect normal x86_64
[ERROR] : (1 failure)

Android: Warning I am seeing when receiving a notification

I am running the latest 1.3.1 Android Module and the latest Appc SDK 7.4.1. When I receive a push notifications I get the following error although everything still works.

[WARN] FirebaseMessaging: Error while parsing timestamp in GCM event

[WARN] FirebaseMessaging: java.lang.NumberFormatException: s == null
[WARN] FirebaseMessaging: at java.lang.Integer.parseInt(Integer.java:570)
[WARN] FirebaseMessaging: at java.lang.Integer.valueOf(Integer.java:794)
[WARN] FirebaseMessaging: at com.google.firebase.messaging.zzd.zzb(Unknown Source:60)
[WARN] FirebaseMessaging: at com.google.firebase.messaging.zzd.zzi(Unknown Source:2)
[WARN] FirebaseMessaging: at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(Unknown Source:277)
[WARN] FirebaseMessaging: at com.google.firebase.iid.zzg.run(Unknown Source:26)
[WARN] FirebaseMessaging: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
[WARN] FirebaseMessaging: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
[WARN] FirebaseMessaging: at java.lang.Thread.run(Thread.java:764)

Message structure inconsistency on Android

Hi,
I'm working on a CommonJS library that handles both Android and iOS notifications by using a shared set of methods.
While working on the Android part, I've noticed that the type of the message field returned by the didReceiveMessage event changes when the notification is received (and tapped) while the app is closed.

In my index.js, I have:

// My CommonJS module, which uses firebase.core and firebase.cloudmessaging
FCM = require('T/firebase/cloudmessaging');
$.index.addEventListener('open', function() {
	// This method is called when the 'didReceiveMessage' event is received
	FCM.onReceived = function(e) {
		Ti.API.warn(e);
	};
	// This method creates the notification channel(s)
	//  and calls registerForPushNotifications()
	FCM.activate();
});

$.index.open();

I'm sending data notifications, using the example in the README.

When the app is already open, didReceiveMessage returns:

{
    "type": "didReceiveMessage",
    "source": {
      ...
    },
    "message": {
        "messageType": null,
        "data": {
            "image": "http://via.placeholder.com/350x150",
            "big_text_summary": "big_text_summary",
            "color": "#ff6600",
            "icon": "http://via.placeholder.com/150x150",
            "title": "title",
            "message": "message",
            "test1": "value1",
            "test2": "value2",
            "force_show_in_foreground": "true",
            "big_text": "big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text ",
            "channelId": "default",
            "timestamp": "2019-01-30 15:05:57"
        },
        "messageId": "...",
        "from": "...",
        "to": null,
        "ttl": 2419200,
        "sendTime": 1548860757317
    },
    "bubbles": false,
    "cancelBubble": false
}

When the app is closed and I open it by tapping the notification, didReceiveMessage is called after I run registerForPushNotifications() and returns:

{
    "type": "didReceiveMessage",
    "source": {
        ...
    },
    "message": {
        "data": "{\"big_text_summary\":\"big_text_summary\",\"icon\":\"http:\\/\\/via.placeholder.com\\/150x150\",\"timestamp\":\"2019-01-30 15:10:29\",\"color\":\"#ff6600\",\"image\":\"http:\\/\\/via.placeholder.com\\/350x150\",\"test1\":\"value1\",\"test2\":\"value2\",\"title\":\"title\",\"big_text\":\"big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text big text even more text \",\"message\":\"message\",\"channelId\":\"default\",\"force_show_in_foreground\":\"true\"}"
    },
    "bubbles": false,
    "cancelBubble": false
}

This is a behavior that we still have in Ti.Goosh, and we handle it by parsing the data:

	// We must be sure that the processed payload is the same on every platform,
	// for this reason we have to parse the JSON as described
	// in Ti.Goosh documentation: https://github.com/caffeinalab/ti.goosh
	if (OS_ANDROID) {
		if (_.isString(e.data)) {
			try {
				e.data = JSON.parse(e.data);
			} catch (ex) {
				e.data = {};
			}
		}
	}

but it's obviously a hack to solve a consistency issue.

Couldn't this be fixed in firebase.cloudmessaging?

didReceiveMessage listener not working

didReceiveMessage listener not getting fired after receiving the push notification.
When app is running not getting notification only receiving the notification when app is in background.

Titanium SDK: 7.1.0. GA
firebase.cloudmessaging : 1.1.0
firebase.core : 1.1.0
Device : iPhone 5S - iOS 11.3

Please share demo code for reference

Cannot build for Android

Im using Titanium SDK @ 7.1.0.GA. Configuration looks like:

<module platform="android" version="1.0.1">firebase.cloudmessaging</module>
<module platform="android" version="2.1.0">firebase.core</module>

Results in error message:

[ERROR] An error occurred during build after 22s 346ms
[ERROR] Conflicting Android Libraries with package name "com.google.firebase.iid" detected:
[ERROR]   /Users/xx/Library/Application Support/Titanium/modules/android/firebase.cloudmessaging/1.0.1/lib/firebase-iid-11.0.4.aar (hash: 2e2a2bf3cf156227413286f9693ced2390685878, origin: Module)
[ERROR]   /Users/xx/Library/Application Support/Titanium/modules/android/firebase.core/2.1.0/lib/firebase-iid-15.0.0.aar (hash: b0db3336a2ffeebda40a006e15e8dc91dac5e55a, origin: Module)
[ERROR]   
[ERROR] Please either select a version of these modules where the conflicting .aar file is the same or you can try removing the .aar file from one module's "lib" folder.

Then, after removing firebase-iid-11.0.4.aar, it comes further in the build process but eventually throws:

[ERROR] Failed to run dexer:
[ERROR]   
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/zzb;
[ERROR] 1 error; aborting

Android: crash if the module is not yet initialized but onTokenRefresh event is called

Crash on this line: https://github.com/hansemannn/titanium-firebase-cloud-messaging/blob/master/android/src/firebase/cloudmessaging/CloudMessagingModule.java#L142

Process: com.communauto.reservauto, PID: 24871
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.kroll.KrollObject.hasListeners(java.lang.String)' on a null object reference
	at org.appcelerator.kroll.KrollProxy.hasListeners(KrollProxy.java:999)
	at firebase.cloudmessaging.CloudMessagingModule.onTokenRefresh(CloudMessagingModule.java:111)
	at firebase.cloudmessaging.TiFirebaseInstanceIDService.onTokenRefresh(TiFirebaseInstanceIDService.java:18)
	at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source:71)
	at com.google.firebase.iid.FirebaseInstanceIdService.handleIntent(Unknown Source:158)
	at com.google.firebase.iid.zzc.run(Unknown Source:4)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)

App in background: Tapping on Notification how to get callback

I want to redirect to specific pages on tap of notification. When app is in killed state redirection is happening fine as I am getting callback via Ti.Android.currentActivity.getIntent(). on alloy.js. When App is in background, tapping on notification it opens the app, how to know app is resuming from notification as well as how to get data.

How to handle push messages

Thanks a lot for this module.

The Documentation explicitly mentions that the didReceiveMessage event is specifically for when direct messages arrive, and that they are different from push notifications.

The question that I have is how do we handle push notifications on Android?

Thanks and Regards

Error building Firebase Cloud Messaging

$ appc ti build -p ios --build-only
Appcelerator Command-Line Interface, version 6.2.4
Copyright (c) 2014-2017, Appcelerator, Inc. All Rights Reserved.

Operating System
Name = Mac OS X
Version = 10.12.2
Architecture = 64bit

CPUs = 4

Memory = 8589934592

Node.js
Node.js Version = 4.6.0
npm Version = 2.15.9

Titanium CLI
CLI Version = 5.0.14

Titanium SDK
SDK Version = 6.2.2.GA
SDK Path = /Users/intermediaMac/Library/Application Support/Titanium/mobilesdk/osx/6.2.2.GA
Target Platform = iphone

Command
/usr/local/bin/node /Users/intermediaMac/.appcelerator/install/6.2.4/package/node_modules/titanium/lib/titanium.js build -p ios --build-only --config-file /var/folders/qd/194dk0mx7835ltxkldv9tnzc0000gn/T/build-1508805247212.json --log-level info --no-banner --project-dir /Users/intermediaMac/Downloads/titanium-firebase-cloud-messaging-master/ios

[INFO] Module ID: firebase.cloudmessaging
[ERROR] [xcode-dist] ** BUILD FAILED **
[ERROR] [xcode-dist] The following build commands failed:
[ERROR] [xcode-dist] CompileC build/titanium-firebase-cloud-messaging.build/Release-iphoneos/titanium-firebase-cloud-messaging.build/Objects-normal/arm64/FirebaseCloudmessagingModule.o Classes/FirebaseCloudmessagingModule.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[ERROR] [xcode-dist] (1 failure)

Android: Vibration

Need to test the vibration settings for Android

createNotificationChannel is not a function

unable to call createNotificationChannel

[ERROR] : TiExceptionHandler: (main) [10,255] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,255] - In /alloy/controllers/index.js:93,17
[ERROR] : TiExceptionHandler: (main) [0,255] - Message: Uncaught TypeError: cloudMessaging.createNotificationChannel is not a function
[ERROR] : TiExceptionHandler: (main) [0,255] - Source: cloudMessaging.createNotificationChannel();
[ERROR] : V8Exception: Exception occurred at /alloy/controllers/index.js:93: Uncaught TypeError: cloudMessaging.createNotificationChannel is not a function

Android: App will freeze if no default icon is present

If notificationicon is not present in drawable and the force_show_in_foreground parameter is used, the module will throw an java.lang.IllegalArgumentException: Invalid notification (no valid small icon), and the app freeze.

How can I catch event 'click' on push-message?

How can I catch event 'click' on push-message in Android? In 'ti.goosh' function 'gcm.registerForPushNotifications' has method "callback". In 'callback' I put function. This function starts when the user clicks on the push-notification. How can I do this with firebase-cloud-messaging?

Android: tapping on a notification message while in foreground

I'm having some problems handling notification and mixed messages.
While the app is closed or in background, notifications are viewed in the tray, and they "restart" the app when tapped. However, if I tap on a notification while the app is in foreground, the launcher is opened again and then nothing happens. The app gets stuck on the launcher screen.

As I understand, this issue is related to how activity stacks are handled by Android and Titanium, but I really don't know how to change this behavior in a way that will simply keep the current stack and activity open if the app is in foreground.

Error on Android 9

Hello;
I am getting those errors from Google Play for Android 9 Devices.

java.lang.IllegalStateException: 
com.google.firebase.FirebaseApp.getInstance (Unknown Source:60)
com.google.firebase.iid.FirebaseInstanceId.getInstance (Unknown Source)
com.google.firebase.iid.FirebaseInstanceIdService.zza (Unknown Source:19)
com.google.firebase.iid.FirebaseInstanceIdService.handleIntent (Unknown Source:158)
com.google.firebase.iid.zzg.run (Unknown Source:26)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
java.lang.Thread.run (Thread.java:784)

Huawei P20 (HWEML), Android 9

java.lang.RuntimeException: 
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3300)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3484)
android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:86)
android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2123)
android.os.Handler.dispatchMessage (Handler.java:109)
android.os.Looper.loop (Looper.java:207)
android.app.ActivityThread.main (ActivityThread.java:7470)
java.lang.reflect.Method.invoke (Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:958)

Caused by: java.lang.NullPointerException: 
org.appcelerator.titanium.TiExceptionHandler.getError (TiExceptionHandler.java:100)
org.appcelerator.titanium.TiExceptionHandler.handleOpenErrorDialog (TiExceptionHandler.java:141)
org.appcelerator.titanium.TiExceptionHandler.openErrorDialog (TiExceptionHandler.java:121)
org.appcelerator.titanium.TiExceptionHandler.handleException (TiExceptionHandler.java:246)
org.appcelerator.kroll.KrollRuntime.dispatchException (KrollRuntime.java:540)
org.appcelerator.titanium.TiApplication$1.uncaughtException (TiApplication.java:365)
org.appcelerator.titanium.TiBaseActivity.onCreate (TiBaseActivity.java:677)
org.appcelerator.titanium.TiActivity.onCreate (TiActivity.java:22)
android.app.Activity.performCreate (Activity.java:7436)
android.app.Activity.performCreate (Activity.java:7426)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1286)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3279)

Android: Exception on receiving of push notification when internet is turned back on and app is in foreground

Scenario:
The internet is turned off and a push notification is triggered from the server. The App is in foreground and the internet is turned on, push notification (data message) is received as the log says

FirebaseMsgService: Message Notification Body: Dear Sachu, Your request is granted.

then the following exception is displayed

[ERROR] :  TiApplication: (pool-10-thread-1) [890,1561171] Sending event: exception on thread: pool-10-thread-1 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'void firebase.cloudmessaging.CloudMessagingModule.onMessageReceived(java.util.HashMap)' on a null object reference; Titanium 7.1.0,2018/03/14 13:40,undefined
[ERROR] :  TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'void firebase.cloudmessaging.CloudMessagingModule.onMessageReceived(java.util.HashMap)' on a null object reference
[ERROR] :  TiApplication: 	at firebase.cloudmessaging.TiFirebaseMessagingService.onMessageReceived(TiFirebaseMessagingService.java:51)
[ERROR] :  TiApplication: 	at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(Unknown Source)
[ERROR] :  TiApplication: 	at com.google.firebase.iid.zzc.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: pool-10-thread-1
[ERROR] :  AndroidRuntime: Process: com.me.ex, PID: 1890
[ERROR] :  AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void firebase.cloudmessaging.CloudMessagingModule.onMessageReceived(java.util.HashMap)' on a null object reference
[ERROR] :  AndroidRuntime: 	at firebase.cloudmessaging.TiFirebaseMessagingService.onMessageReceived(TiFirebaseMessagingService.java:51)
[ERROR] :  AndroidRuntime: 	at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(Unknown Source)
[ERROR] :  AndroidRuntime: 	at com.google.firebase.iid.zzc.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)

I'm using the titanium-firebase-cloud-messaging version android-1.0.2 and titanium sdk version 7.1.0

Could you please let me know how to handle this?

Notifications come duplicated on devices with android 6.0

I am sending notifications from my php server to the firebase cloud message. On devices with android greater than 6.0 the notification arrives right, but in smaller than 6.0 arrives duplicated as in the image below.

Screen Shot 2019-04-02 at 11 33 06

My Code:

$url = 'https://fcm.googleapis.com/fcm/send';

$fields = [
    'registration_ids' => $tokens,
    'notification' => [
        'title' => $notification['title'],
        'body' => $notification['body'],
        'sound' => 'default'
    ]/*,
    'data' => [
        'key1' => 'value1',
        'key2' => 'value2'
    ]*/
];

if ($notification['badge'] != null && $notification['badge'] !== 0) {
	$fields['notification']['badge'] = $notification['badge'];
}

$headers = [
    'Authorization: key=XXXXXXXXXX', 'Content-Type: application/json'
];
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));

$result = curl_exec($ch);
curl_close($ch);

When I send a message, directly through the firebase panel for android devices smaller than 6.0 the notification arrives correct .... but when I send that by my php code, on devices larger than 6.0 it arrives ONLY ONE NOTIFICATION and in less than 6.0 it arrives duplicate .

Android 9 -Failed to start service while in background - 7.5.0.GA

Hello. Good afternoon. I noticed this issue.

Titanium SDK 7.5.0.GA
Device: Huawei P20 PRO
Android version : 9

When the screen of the mobile device is off, and I try to install the app with this module of firebase-cloud-messaging with titanium-firebase-core; I am getting the following:

https://github.com/hansemannn/titanium-firebase-cloud-messaging/releases/tag/android-1.4.0
https://github.com/hansemannn/titanium-firebase-core/releases/tag/android-3.0.2

[ERROR] FirebaseInstanceId: Failed to start service while in background: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.tony.tony cmp=com.tony.tony/firebase.cloudmessaging.TiFirebaseInstanceIDService (has extras) }: app is in background uid UidRecord{709d7a u0a229 TPSL idle procs:1 seq(0,0,0)}

so this is prouducing the
02-19 13:27:57.693 28810-28810/? I/TiAPI: Token is empty. Waiting for the token callback ...

Thanks, and best,
Antonio.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.