![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@sendbird/react-native-push-extension
Advanced tools
Sendbird Push Notifications extension for React-Native
yarn add @sendbird/react-native-push-extension
Use iOS's App Groups for device token tracking and analysis of Sendbird push notifications.
Update the AppDelegate.h
and AppDelegate.mm
files to implement UserNotificationCenterDelegate and configure NotificationServiceExtension.
// AppDelegate.h
#import <UserNotifications/UNUserNotificationCenter.h>
@interface AppDelegate : RCTAppDelegate<UNUserNotificationCenterDelegate>
// AppDelegate.mm
#import "SendbirdNotificationHelper.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...
// SendbirdPushExtension: set app group
[SendbirdNotificationHelper setAppGroup:@"your.app.group.name"]; // Set your App Groups name here
// ...
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
// SendbirdPushExtension: register device token
[SendbirdNotificationHelper didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
Note: This step is optional If your app is already using NotificationServiceExtension.
In the XCode top menu, click [File > New > Target > Notification Service Extension] to create it.
To link the extension, update the Podfile.
target 'NotificationServiceExtension' do
// The below use_frameworks part may differ by project, so handle it according to your project's Podfile settings.
// use_frameworks! :linkage => :static
pod 'sendbird-notifications-extension', :path => '../node_modules/@sendbird/react-native-push-extension'
end
After making the modifications, connect the module to your project with the npx pod-install
command. Then modify the NotificationService
file in the NotificationServiceExtension created in XCode.
// NotificationService.m
#import "SendbirdNotificationHelper.h"
@implementation NotificationService
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
// ...
// SendbirdPushExtension: set app group
[SendbirdNotificationHelper setAppGroup:@"your.app.group.name"]; // Set your App Groups name here
// SendbirdPushExtension: call markPushNotificationAsDelivered()
[SendbirdNotificationHelper markPushNotificationAsDelivered:self.bestAttemptContent.userInfo completionHandler:nil];
// ...
}
// NotificationService.swift
import sendbird_notifications_extension
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
// ...
// SendbirdPushExtension: set app group
SendbirdNotificationHelper.setAppGroup("your.app.group.name")
// SendbirdPushExtension: call markPushNotificationAsDelivered()
SendbirdNotificationHelper.markPushNotification(asDelivered: bestAttemptContent.userInfo)
// ...
}
iOS typically receives push notifications while the app is in the background.
However, notifications can also be delivered when the app is active and in the foreground.
If a notification arrives without displaying a banner, it may still be marked as DELIVERED
by the Sendbird system.
Implement the willPresentNotification
method to ensure notifications are presented to the user during these cases.
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
{
if (notification.request.content.userInfo[@"sendbird"] != nil) {
completionHandler(UNNotificationPresentationOptionAlert);
}
}
If you encounter a build error indicating a conflict with Firebase (e.g., [CP-User][RNFB] ~~
), adjust the placement of the Embed Frameworks extension in the project's Build Phases.
MIT
Made with create-react-native-library
1.0.0
markPushNotificationAsDelivered
didRegisterForRemoteNotificationsWithDeviceToken
setAppGroup
FAQs
Push Notifications extension for React-Native
We found that @sendbird/react-native-push-extension demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.