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

[FIX #4327] Migrate to react-native-firebase #4446

Closed
wants to merge 22 commits into from
Closed

[FIX #4327] Migrate to react-native-firebase #4446

wants to merge 22 commits into from

Conversation

georgiemathews
Copy link
Contributor

Fixes #4327

Summary:

Migrates Notifications to use invertase/react-native-firebase

Review notes (optional):

Testing notes (optional):

Steps to test:

  • Open Status
  • Accept Notifications Request
  • See if notifications are received

status: ready

@pedropombeiro
Copy link
Contributor

Thanks for the PR @georgiemathews!

The build is currently failing in Jenkins:

image

Copy link
Contributor

@jeluard jeluard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of changes look unrelated with the issue. Could we reduce the scope of this PR?

@@ -207,7 +208,7 @@ dependencies {
implementation "com.android.support:appcompat-v7:26.1.0"
// Force using exact RN version instead of relying on gradle dependency resolution
// https://docs.gradle.org/current/userguide/introduction_dependency_management.html#sec:dependency_resolution
compile ("com.facebook.react:react-native:0.53.3") { force = true } // From node_modules
implementation ("com.facebook.react:react-native:0.53.3") { force = true } // From node_modules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

@georgiemathews georgiemathews May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmitryn WDYT? Looks like it's reverting your recent change?

implementation 'com.google.firebase:firebase-core:15.0.2' //this decides your firebase SDK version
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
implementation project(':react-native-testfairy')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please comment why we need all those.

Copy link
Contributor Author

@georgiemathews georgiemathews May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image
shortcut badger allows for badges on android

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

badges? Don't think we want that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay @jeluard, will revert that as well.

@@ -9,6 +9,8 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This require comment too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required for the notifications
image

<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:resizeableActivity="false"
android:launchMode="singleTask">
android:launchMode="singleTop">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was recommended in the react-native-firebase, but I've looked into it and singleTask will functionally work as well. I'll revert this

@Override
public void onNewIntent(final Intent intent) {
if (intent.getDataString() != null && intent.getData().getScheme().startsWith("app-settings")) {
startActivity(createNotificationSettingsIntent());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related?

Copy link
Contributor Author

@georgiemathews georgiemathews May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is from the react-native-fcm documentation
screen shot 2018-05-25 at 7 58 04 am

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's not the same thing you removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeluard thanks for the catch, I see this was implemented for easy access to the settings from profile. Thanks, will revert

classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image

@@ -25,5 +24,6 @@ allprojects {
flatDir { dirs 'libs' }
maven { url "http://139.162.11.12:8081/artifactory/libs-release-local" }
maven { url "https://jitpack.io" }
google()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already there. Any reason to change its place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

ios/Podfile Outdated
@@ -11,13 +11,14 @@
#pod 'Firebase/Messaging', '3.17.0'

target 'StatusIm' do
platform :ios, '8.0'
platform :ios, '9.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does that mean with regards for supported mobiles?

ios/Podfile.lock Outdated

COCOAPODS: 1.3.1
COCOAPODS: 1.5.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also required?

package.json Outdated
"react-native-fetch-polyfill": "1.1.2",
"react-native-firebase": "^4.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want fixed versions.

android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_status_notification" />
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_ic_notification" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting a build error regarding this resource:

 AAPT: No resource found that matches the given name (at 'resource' with value '@drawable/ic_stat_ic_notification').

Is this change intentional?

@pedropombeiro
Copy link
Contributor

@georgiemathews I'm seeing this when attempting to run your branch. Any ideas?

image

@georgiemathews
Copy link
Contributor Author

@pombeirp should be fixed now!

@pedropombeiro
Copy link
Contributor

Confirmed that app is able to send PNs on this branch. Could you please rebase on latest develop branch @georgiemathews?

@pedropombeiro
Copy link
Contributor

@georgiemathews there must have been a problem in the new rebase, it rolls back the upgrade in a2762eb. I believe it also removed babel-polyfill from package-lock.json, not sure if that is intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Migrate from react-native-fcm to react-native-firebase
5 participants