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

Android 8 Support #698

Closed
jallynme opened this issue Dec 19, 2017 · 25 comments
Closed

Android 8 Support #698

jallynme opened this issue Dec 19, 2017 · 25 comments

Comments

@jallynme
Copy link

for Android 5 & 6 it's working fine but for Android 8 Device I cann't get any notification

@evollu
Copy link
Owner

evollu commented Dec 19, 2017

what is your build target SDK? android 8?

@jallynme
Copy link
Author

Hi I use 26.0.0 for android 8

@evollu
Copy link
Owner

evollu commented Dec 20, 2017

might have to do with new SDK broadcasting limitation.
are you using the latest version of react-native-fcm?

@evollu
Copy link
Owner

evollu commented Dec 20, 2017

try change your target SDK to be 25.

UPDATE
android 8 has a breaking change which requires you to create notification channel first and associate all notifications to channels
it is still backward compatible for app built with SDK <=25 though.

@evollu
Copy link
Owner

evollu commented Dec 20, 2017

well I've figured how to bridge the new change, but can't upgrade com.android.support:support-core-utils to >26 as the app crashes.

Any help to solve this problem is welcome.
#699

@jallynme
Copy link
Author

I use latest version of react-native-fcm so thanks for update

@haggholm
Copy link
Contributor

haggholm commented Jan 4, 2018

I successfully built and ran the sdk-26 branch and verified it on two images (SDK 25 and 27, before and after the API changes to ensure compatibility), after making some small fixes (#726). I didn’t see any crashes.

@evollu
Copy link
Owner

evollu commented Jan 5, 2018

@haggholm Have you tried to use it together with other packages that uses firebase SDK like react-native-firebase? any resolution challenge?
I can't have the example project working

@haggholm
Copy link
Contributor

haggholm commented Jan 5, 2018

No, I don’t think the application uses Firebase except for this.

@evollu
Copy link
Owner

evollu commented Jan 5, 2018

@haggholm so the example project works for you?

@haggholm
Copy link
Contributor

haggholm commented Jan 6, 2018

@evollu I haven’t tried the example project—I’ll find a moment to do so, but when I was trying things out, I was somewhat urgently trying to get our own product running!

@evollu
Copy link
Owner

evollu commented Jan 8, 2018

@haggholm if you want to target sdk 26 now you can use this sdk-26 branch.
But there is risk as react-native itself may not fully support compiling against sdk 26.

@evollu evollu mentioned this issue Feb 5, 2018
@addingama
Copy link

addingama commented Apr 24, 2018

@evollu I've used sdk-26 branch but the local notification not working. Remote notification still working when the app on background

@evollu
Copy link
Owner

evollu commented Apr 24, 2018

@dashracer did you register your notification channel?

@chanramadhan
Copy link

chanramadhan commented Jun 28, 2018

i'am register channel in my app, but notification in android 8 in galaxy s8 not work. @evollu

@chanramadhan
Copy link

i'm send push use PHP

@evollu
Copy link
Owner

evollu commented Jul 2, 2018

@chanramadhan have you set default notification channel for firebase notifications?

@evollu evollu closed this as completed Jul 2, 2018
@chanramadhan
Copy link

@evollu i set High in my notification channel but not work in android 8 (Galaxy S8), can you help me?

@evollu
Copy link
Owner

evollu commented Jul 3, 2018

@chanramadhan are you talking about remote notificaiton? if so, do you have this?
<meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="my_default_channel"/>

@chanramadhan
Copy link

@evollu yes, i have this

in my androidmanifest. but not work in android 8

@colinwitkamp
Copy link

The below solution worked for me!
channel should be passed.

const notificationChannelId = 'my_notif_channel';

await FCM.createNotificationChannel({
    id: notificationChannelId,
    name: notificationChannelId,
    priority: 'max'
  });
...

FCM.presentLocalNotification({
   ..(notification parameters),
    channel: notificationChannelId
  })

@kaytee319
Copy link

kaytee319 commented Aug 1, 2018

"FIXED"
In your notification payload set "channel": "default"

{
"to":"fcm_token",
"data": {
"custom_notification": {
"body": "Hey There",
"title": "I am APP",
"color":"#00ACD4",
"priority":"high",
"icon":"ic_notif",
"channel": "default",
"groupSummary": true,
"show_in_foreground": true
}
}
}

@404sand808s
Copy link

Thanks @kaytee319, for some reason this advice you just gave is extremely hard to find elsewhere on the interwebs!

@wmonecke
Copy link

Hey!
.createNotificationChannel() is not available on my FCM object. Do I need to upgrade?

@rajeshsmallarc
Copy link

Yes @wmonecke

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

No branches or pull requests

10 participants