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

Scheduled notification is not coming android #2387

Open
AjayGol opened this issue Oct 6, 2023 · 0 comments
Open

Scheduled notification is not coming android #2387

AjayGol opened this issue Oct 6, 2023 · 0 comments

Comments

@AjayGol
Copy link

AjayGol commented Oct 6, 2023

Bug

<--
This is my code.

function pushNotif(){
PushNotification.createChannel(
{
channelId: "specialid", // (required)
channelName: "Special messasge", // (required)
channelDescription: "Notification for special message", // (optional) default: undefined.
importance: 4, // (optional) default: 4. Int value of the Android notification importance
vibrate: true, // (optional) default: true. Creates the default vibration patten if true.
},
(created) => console.log(createChannel returned '${created}') // (optional) callback returns whether the channel was created, false means it already existed.
);

PushNotification.localNotificationSchedule({
channelId:'specialid', //his must be same with channelid in createchannel
title:'hello',
message:'test message'
})
}

index.js
-->>

PushNotification.configure({
onRegister: function (token) {
console.log('TOKEN:', token);
},

// (required) Called when a remote is received or opened, or local notification is opened
onNotification: function (notification) {
console.log('NOTIFICATION:', notification);

// process the notification

// (required) Called when a remote is received or opened, or local notification is opened
notification.finish(PushNotificationIOS.FetchResult.NoData);

},

// (optional) Called when Registered Action is pressed and invokeApp is false, if true onNotification will be called (Android)
onAction: function (notification) {
console.log('ACTION:', notification.action);
console.log('NOTIFICATION:', notification);

// process the action

},

// (optional) Called when the user fails to register for remote notifications. Typically occurs when APNS is having issues, or the device is a simulator. (iOS)
onRegistrationError: function (err) {
console.error(err.message, err);
},

// IOS ONLY (optional): default: all - Permissions to register.
permissions: {
alert: true,
badge: true,
sound: true,
},

// Should the initial notification be popped automatically
// default: true
popInitialNotification: true,

/**

  • (optional) default: true
    • Specified if permissions (ios) and token (android and ios) will requested or not,
    • if not, you must call PushNotificationsHandler.requestPermissions() later
    • if you are not using remote notification or do not have Firebase installed, use this:
  • requestPermissions: Platform.OS === 'ios'
    

*/
requestPermissions: false,
});

<--

-->** not coming notification in android **

Please give me answer

react native version: 0.72.4
android : 12

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

1 participant