-
Couldn't load subscription status.
- Fork 296
Closed
Description
Feature Request
Add the possibility for local notifications (e.g. as in PushNotificationIOS.presentLocalNotification()) to include threadIdentifier on its details.
Why it is needed
Using the threadIdentifier allows to group notifications together on the notification center
Possible implementation
I'm happy to send a PR, it seems to me it should be as simple as adding the parsing of that parameter on the UILocalNotification object. This would be an iOS only property
@implementation RCTConvert (UILocalNotification)
+ (UILocalNotification *)UILocalNotification:(id)json
{
NSDictionary<NSString *, id> *details = [self NSDictionary:json];
....
if (details[@"threadIdentifier"]) {
notification.threadIdentifier = [RCTConvert NSString:details[@"threadIdentifier"]];
}
return notification;
}
(Adding the if statement because I guess that if not explicitly set, iOS sets a "smart" threadIdentifier based on application, title, etc.)
Code sample
PushNotificationIOS.presentLocalNotification({
// should also work with PushNotificationIOS.scheduleLocalNotification
alertTitle: "My threaded local notification"
alertBody: "This will be threaded",
threadIdentifier: "SomeIdentifier"
})
Naturalclar
Metadata
Metadata
Assignees
Labels
No labels