unable to integrate One-Signal Push notification in ios

巧了我就是萌 提交于 2019-12-11 05:51:43

问题


i have tried to integrate One-signal as per given documents on their site but when i install framwork through podfile , at this time i got 0 percent dependancy

so how to integrate proper way??? in ios Xcode 8.

i have tried this Steps:

Option A: Use CocoaPods (Recommended)

Setting up CocoaPods on your system if you don't have it already.

    Make sure you have the latest 1.1.0 version by running pod --version from the terminal.
    Run the following to upgrade sudo gem install cocoapods

1.1 Make sure your current Xcode project is closed.
1.2 Run pod init
1.3 Run echo "pod 'OneSignal'" >> Podfile
     NOTE (React Native only) : Run echo "pod 'OneSignal', '~> 1.13.3'" >> Podfile instead.
1.3 Run pod install
1.4 Open the newly created .xcworkspace file.

https://documentation.onesignal.com/docs/ios-sdk-setup


回答1:


I have noticed that the cocoaPods fails with iOS. I recommend doing the manual way.

  1. Download the sdk from here:

https://github.com/OneSignal/OneSignal-iOS-SDK

  1. Import the oneSignal.h and .m into your project.
  2. Remember to go to capabilities and activate Remote notifications
  3. Add this lines of code in your AppDelegate or wherever you would like to activate push notifications (Replace with your credentials):

    self.oneSignal = [[OneSignal alloc] initWithLaunchOptions:launchOptions
                                        appId:@"YOUR APP ID IN HERE"
                                        handleNotification:nil];
    
  4. Finally follow my question and you are ready to go. Good Luck! https://stackoverflow.com/a/39135807/2551707



来源:https://stackoverflow.com/questions/41095726/unable-to-integrate-one-signal-push-notification-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!