Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase support - internal dependencies #83

Open
antonioduran opened this issue Feb 26, 2019 · 5 comments
Open

Firebase support - internal dependencies #83

antonioduran opened this issue Feb 26, 2019 · 5 comments

Comments

@antonioduran
Copy link

Hello. As you know google will be deprecated GCM in April 11th, so this module is working with GCM, but does anybody know whether this module will have support for firebase? I mean to update all the internal dependencies of the module to firebase.

Thanks.

@chmiiller
Copy link
Collaborator

We really need to work this out. I have no knowledge on that part of the module. Do you know who started the implementation of it on Android? @jvandijk Jeroen, maybe you know something or someone?

@jvandijk
Copy link
Collaborator

jvandijk commented Mar 3, 2019

I haven't tested this, but as far as I can see this has been completely abstracted away by the OneSignal library itself. This still supports both GCM & FCM, it's just up to you to configure one in the OneSignal user interface and only use the OneSignal app id. In the past you also had to put in a Google project number, but is now fetched automatically to support both GCM & FCM.

@antonioduran
Copy link
Author

Hey hello @jvandijk. Perhaps, I am wrong, but what about the following; not sure, but this module seems that it is not using FCM SDK, but according to Google we should remove / update the following:

Switch to FCM in the app-level build.gradle

Before

dependencies {
  compile "com.google.android.gms:play-services-gcm:16.0.0"
}

After

dependencies {
  compile "com.google.firebase:firebase-messaging:17.3.4"
}

FCM SDK automatically adds all required permissions as well as the required receiver funtionality. Make sure to remove the following obsolete (and potentially harmful, as they may cause message duplication) elements from your app's manifest:

Remove from AndroidManifest.xml

<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="<your-package-name>.permission.C2D_MESSAGE"
            android:protectionLevel="signature" />
<uses-permission android:name="<your-package-name>.permission.C2D_MESSAGE" />

...

<receiver
    android:name="com.google.android.gms.gcm.GcmReceiver"
    android:exported="true"
    android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <category android:name="com.example.gcm" />
    </intent-filter>
</receiver>

I noticed part of the above code in the following link:
https://github.com/williamrijksen/com.williamrijksen.onesignal/blob/5714d54ea70745092725d6e70ea8a363c4738ae1/android/timodule.xml

Reference: https://developers.google.com/cloud-messaging/android/android-migrate-fcm

@AndreaVitale
Copy link

AndreaVitale commented Jul 15, 2019

Got it to work:

  • include firebase.core module
  • include firebase.cloudmessaging module

removed all stuffs from manifest like @antonioduran says and now I get inside the console

[WARN] OneSignal: Both GCM & FCM Libraries detected! Please remove the deprecated GCM library.

Unfortunately I think that we cannot completely remove GCM because is built in inside ti.playservices module.

@deckameron
Copy link

In case you would like to test it with FCM, here is the module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants