Skip to content

Instantly share code, notes, and snippets.

@b-tiwari
Created October 21, 2018 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b-tiwari/e2d17d8b69816d02eee19a76b7484ee4 to your computer and use it in GitHub Desktop.
Save b-tiwari/e2d17d8b69816d02eee19a76b7484ee4 to your computer and use it in GitHub Desktop.
AppDelegate.m
// Required to register for notifications
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
[RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings];
}
// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[RCTPushNotificationManager didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for the localNotification event.
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
[RCTPushNotificationManager didReceiveLocalNotification:notification];
}
@helpi221
Copy link

hi I want create a header like as you did. for me its did not work. are you able to help me how i can fix it?

Error: Text strings must be rendered within a component.

This error is located at:
in RCTView (at home.tsx:12)
in RCTView (at home.tsx:10)
in Home (at SceneView.tsx:122)
in StaticContainer
in StaticContainer (at SceneView.tsx:115)
in EnsureSingleNavigator (at SceneView.tsx:114)
in SceneView (at useDescriptors.tsx:150)
in RCTView (at ResourceSavingScene.tsx:43)
in RCTView (at ResourceSavingScene.tsx:26)
in ResourceSavingScene (at DrawerView.tsx:170)
in RCTView (at src/index.native.js:132)
in ScreenContainer (at DrawerView.tsx:154)
in RCTView (at Drawer.tsx:643)
in RCTView (at createAnimatedComponent.js:233)
in AnimatedComponent(Component) (at Drawer.tsx:636)
in RCTView (at createAnimatedComponent.js:233)
in AnimatedComponent(Component) (at Drawer.tsx:626)
in PanGestureHandler (at GestureHandlerNative.tsx:13)
in PanGestureHandler (at Drawer.tsx:617)
in DrawerView (at DrawerView.tsx:191)
in RNCSafeAreaProvider (at SafeAreaContext.tsx:74)
in SafeAreaProvider (at SafeAreaProviderCompat.tsx:42)
in SafeAreaProviderCompat (at DrawerView.tsx:189)
in RCTView (at DrawerView.tsx:188)
in DrawerView (at createDrawerNavigator.tsx:44)
in DrawerNavigator (at hamburgermenu.tsx:21)
in MyDrawer (at App.tsx:10)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:390)
in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
in ThemeProvider (at NavigationContainer.tsx:90)
in ForwardRef(NavigationContainer) (at App.tsx:9)
in App (created by ExpoRoot)
in RNCAppearanceProvider (at src/index.tsx:70)
in AppearanceProvider (created by ExpoRoot)
in ExpoRoot (at renderApplication.js:45)
in RCTView (at AppContainer.js:109)
in DevAppContainer (at AppContainer.js:124)
in RCTView (at AppContainer.js:135)
in AppContainer (at renderApplication.js:39)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment