react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

Onesignal.h file not found

Open radiegtya opened this issue 10 years ago • 12 comments

in my xcode proj, I can't build my project.

onesignalerr

radiegtya avatar Apr 17 '16 14:04 radiegtya

i have same problem

algosubi avatar Apr 19 '16 05:04 algosubi

You can fix it by adding the OneSignal library though CocoaPods.

francocorreasosa avatar Apr 21 '16 00:04 francocorreasosa

Never use cocoapods before, but I'll try

radiegtya avatar Apr 21 '16 06:04 radiegtya

Please add the necessary Pod, since it's part of the setup process.

avishayil avatar Apr 24 '16 10:04 avishayil

If you don't want to use CocoaPods and correct follow this 2 steps

  1. Add OneSignal.framework that is in ../node_modules/react-native-onesignal/ios/Frameworks/OneSignal.framework in YourProject > Build Phases > Link Binary With Libraries
  2. Add "$(SRCROOT)/../node_modules/react-native-onesignal/ios/Frameworks" in YourProject > Build Settings > Framework Search Paths

lucasyalap avatar Jul 29 '16 14:07 lucasyalap

Aleready did this, but still error.

On Friday, 29 July 2016, lucasyalap [email protected] wrote:

If you don't want to use CocoaPods and correct follow this 2 steps

  1. Add OneSignal.framework that is in ../node_modules/react-native-onesignal/ios/Frameworks/OneSignal.framework in YourProject > Build Phases > Link Binary With Libraries
  2. Add "$(SRCROOT)/../node_modules/react-native-onesignal/ios/Frameworks" in YourProject > Build Settings > Framework Search Paths

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/geektimecoil/react-native-onesignal/issues/19#issuecomment-236196196, or mute the thread https://github.com/notifications/unsubscribe-auth/ACD71lMgJ_q_VZoENrHdVAFxmobcH4F4ks5qag7mgaJpZM4IJK96 .

radiegtya avatar Jul 30 '16 16:07 radiegtya

Please can you show us :

  • Screenshot of code error (again)
  • YourProject > Build Phases > Link Binary With Libraries
  • YourProject > Build Settings > Framework Search Paths

Because normally if did what i said it works.

lucasyalap avatar Jul 30 '16 18:07 lucasyalap

Here is my screenshot, sorry for very late response, please help @lucasyalap:

onesignal_1 onesignal_2 onesignal_3

radiegtya avatar Sep 07 '16 05:09 radiegtya

RCTOnesignal.h already found. Now I have new problem, when using xcode:

onesignal_4

While using cocoapod, I had different error message:

onesignal_5

Please help

radiegtya avatar Sep 07 '16 05:09 radiegtya

If you realy don't want to use pods, you have to remove all about pods

  1. In left panel remove pods project
  2. In Left panel remove pods directory
  3. in "YourProject > Build Phases > Link Binary With Libraries" remove libPods-OneSignal.a
  4. "YourProject > Build Settings > Framework Search Paths" remove "$(PODS_ROOT)/OneSignal/IOS_SDK/Frameworks"

If you have any other errors please send screenshot

lucasyalap avatar Sep 07 '16 10:09 lucasyalap

THanks a lot @lucasyalap, now all the error had gone. And the user already registered on onesignal users list. But ios simulator can't receive the push notif, I'll test tomorrow on real device and share with you if fail or success. Btw why don't author of this package suggest those simple step by step like yours rather than using pods? Regards

radiegtya avatar Sep 07 '16 11:09 radiegtya

i'm on react-native 0.37 and here's how i was able to get this to work (i think the readmes/documentation are slightly behind react native).

  1. on a clean branch with none of the onesignal work...
  2. run npm install react-native-onesignal --save
  3. run react-native link
  4. for iOS follow the podfile instructions (be sure to follow the react native version note carefully)
  5. for iOS follow the code additions in the instructions
  6. for android follow the android instructions (most of the code should be there from the link command, but double check everything)
  7. for android be sure to use import com.geektime.reactnativeonesignal.ReactNativeOneSignalPackage; and NOT import com.geektime.rnonesignal.ReactNativeOneSignalPackage; (some old documentation had the rnonesignal and that's since been updated)
  8. then complete config and setup and all files
  9. hopefully that does the trick for you...please reply if you have any issues as i spent some time on both android and iOS over a few branches to get this to work.

YMMV if you are using something lower than v0.37 of RN. good luck.

jakeatwork avatar Dec 02 '16 22:12 jakeatwork