Skip to content

[Proposal][WIP] Messaging / FCM overhaul #595

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

Closed
chrisbianca opened this issue Nov 8, 2017 · 32 comments
Closed

[Proposal][WIP] Messaging / FCM overhaul #595

chrisbianca opened this issue Nov 8, 2017 · 32 comments
Labels
platform: android platform: ios plugin: messaging FCM only - ( messaging() ) - do not use for Notifications

Comments

@chrisbianca
Copy link
Contributor

chrisbianca commented Nov 8, 2017

Messaging and FCM is an area that has fallen behind the rest of the library in terms of ease of use, documentation and reliability. We plan on overhauling this completely for the 3.3.0 release and rewriting from scratch to ensure that it provides the core FCM functionality in an easy to use and reliable manner.

This issue is currently a placeholder that will be updated as we agree exactly what we will support and how this will be structured in the API. It's also here to show that we're aware of the issues that have already been raised and will be addressing them as part of this work.

To help support this development and sustain the library long term, please consider backing us on Open Collective.

@akshetpandey
Copy link

FR: Notification Channels for Android O

@krystiansliwa
Copy link

Hi, when do you plan to release version with those fixes?

@agonbina
Copy link

agonbina commented Nov 27, 2017

Can we split this in such a way that we could also contribute? I would be happy to help out because this is one of the core features of firebase which I assume most people use/want to use so it only makes sense that it is as stable as the underlying SDK implementation.

@tranquan
Copy link

tranquan commented Dec 2, 2017

Hi, I have an issue with getInitialNotification, it is not working properly if MainActivity is not configure as a Launcher.

On my app, I configure a SplashActivity as a Launcher to display a SplashScreen while app loading. But when I send the notification from firebase when app exit, then tap on the notification to open the app, getInitialNotification is not return the payload that I have sent.

Step to reproduce:

  1. quit the app
  2. send a notification from firebase
  3. open app from the notification

Everything working fine if the MainActivity is the Launcher. Here is my configure:

Configure:

My AndroidManifest.xml

<activity
    android:name=".SplashActivity"
    android:label="@string/app_name"
    android:theme="@style/SplashTheme">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

<activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:theme="@style/SplashTheme"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:launchMode="singleTop"
    android:windowSoftInputMode="adjustResize">
</activity>

On SplashActivity, I simply start MainActivity
My SplashActivity

public class SplashActivity extends AppCompatActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent intent = new Intent(this, MainActivity.class);
    startActivity(intent);
    finish();
  }
}

Bug

On React Native, I call getInitialNotification(), but got a weird payload

messaging.getInitialNotification().then((payload) => {
	console.log('getInitialNotification: ', payload);
});

This is the log of payload, it's expected to have the information that I've sent, but not.

{
    opened_from_tray:true
    fcm: {
        action:null
     }
}

My Firebase Notification Payload:

{
   "to": "/topics/user-3322",
   "content_available" : false,
   "notification" : {
       "title": "this is title",
       "body": "this is message's body"
   },
   "data": {
   		"type": 1,
	     "extra_data":{
			"title":"this is title",
	    	"body":"this is message's body"
	     }
   }
}

@sapjunior
Copy link

@tranquan I also encounter the same situation. Is your project use wix/react-native-navigation?

@krystiansliwa
Copy link

@tranquan @sapjunior I also encounter that problem and I have some workaround for it here #151 (comment)

@gaultierq
Copy link

Hello,
Any idea of when we will be able to use this library for messaging ?
Just to know if I should wait or find another solution.
Thanks for your hard work !

@tranquan
Copy link

@krystiansliwa wow, nice solution (y) I've just tried and it worked perfectly, thanks a lot

@chrisbianca chrisbianca removed this from the v3.2.0 Release milestone Dec 17, 2017
@Salakar
Copy link
Contributor

Salakar commented Feb 12, 2018

For those want to track the progress of this see this branch.

@Jacse
Copy link

Jacse commented Feb 19, 2018

@chrisbianca awesome you're tackling this. Looking forward!

@gaultierq
Copy link

oh. so the milestone for this issue is v4.0.0 now ? does i mean that it will be released later on ? I am checking this thread everyday :D

@chrisbianca
Copy link
Contributor Author

Don't worry, it is very much in progress, but as it's such a big change we're likely to run it as an alpha for a little while.

We didn't want this to stop us getting Firestore transactions out which will be the main part of v3.3.0.

@gaultierq
Copy link

ok great thx 👍

@chrisbianca
Copy link
Contributor Author

Good news, the long awaited alpha of our messaging and notifications overhaul is now available!!

Check out the release notes here: https://github.com/invertase/react-native-firebase/releases/tag/v4.0.0-alpha.1

If you have any comments and suggestions or want to report an issue, come find us on Discord

@yarian
Copy link

yarian commented Mar 22, 2018

Quick question as someone who is integrating with this library for the first time specifically for push notifications. If you had to integrate with this library in the next two days, would you do v4 even though it's in alpha or v3 even if though it means rewriting for v4 later?

@hegelstad
Copy link

hegelstad commented Mar 22, 2018 via email

@chrisbianca
Copy link
Contributor Author

I'm glad you think that @hegelstad. I'd also go with v4 - it's far more tested than v3 despite it's alpha status, there's better documentation and if all goes well it won't be in alpha for more than a week or so...

@chrisbianca
Copy link
Contributor Author

Any volunteers who'd like to look at adding some typescript definitions for messaging and notifications?

@matheusmatos
Copy link

@chrisbianca I can help with it =)

@chrisbianca
Copy link
Contributor Author

chrisbianca commented Mar 23, 2018

Just published a release candidate with a couple of other tasty treats (Firebase Invites, multi-database support and an overhaul of Dynamic Links): See the release notes for our latest release candidate

@Salakar
Copy link
Contributor

Salakar commented Mar 26, 2018

Going to close this now as we're close to a full release of v4 and there has been plenty of successful early testers on the alpha and RC versions.

Let's move discussions and feedback to the v4-fcm-notifications channel on discord. If you're flagging bugs for v4 please tag your github issue title with [v4] to allow us to spot them easier.

Thanks all for the feedback and thanks to all the early adopters/testers ❤️

@Salakar Salakar closed this as completed Mar 26, 2018
@invertase invertase locked as resolved and limited conversation to collaborators Mar 26, 2018
@invertase invertase unlocked this conversation Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: android platform: ios plugin: messaging FCM only - ( messaging() ) - do not use for Notifications
Projects
None yet
Development

No branches or pull requests