react-native: push notifications + parse

前端 未结 3 1430
难免孤独
难免孤独 2021-01-31 22:33

I am currently working on a small app project to learn and try out react-native on iOS. I have some experience with parse (parse.com) and would love to integreate parse in the n

3条回答
  •  不要未来只要你来
    2021-01-31 22:48

    I did some investigation with the Parse + react-native combination and have it working.

    You have to add the Parse SDK (follow the guide) to your project, and link all the necessary libraries.

    Don't forget to add the steps on point 5: https://parse.com/tutorials/ios-push-notifications.

    Then add RCTPushNotificationManager.h + m (from react-native/Libraries) to your project. After that, add the following in AppDelegate.m:

    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
    [[NSNotificationCenter defaultCenter] postNotificationName:@"RemoteNotificationReceived"
                                                        object:self
                                                      userInfo:userInfo];
    }
    

    That should do it.

提交回复
热议问题