hamid mohammadi
hamid mohammadi

Reputation: 83

onesignal/onesignal.h file not found

hi , i have strange problem to work and debug my project

The Error says : onesignal/onesignal.h file not found

i install and update pod without any error or problem through Console ,

i attach some screenshot that show error better

image1

image2

where is the problem ? why i have not onesignal.h file after install it , and how can i fix this ?

please help me i stuck in this for a few weeks

Upvotes: 7

Views: 22466

Answers (4)

M.Bilal Murtaza
M.Bilal Murtaza

Reputation: 1973

You should remove

use_frameworks!

from ios/Podfile

That will be work for me :)

Upvotes: -2

Joe Naber
Joe Naber

Reputation: 537

cd platforms/ios

pod repo update

pod install

explanation: you need to navigate in to the ios platform directory where the .podfile exists, and then run the commands "pod repo update" and then "pod install"

Upvotes: 11

Florin Dobre
Florin Dobre

Reputation: 10252

Updated answer: I faced this again at an update from 3.0.7 (or later)

I fixed it with the following steps:

  1. Adding a notification extension as described in the react-native-onesignal docs.

  2. Remove the old imports and code from AppDelegate.m

Removed lines:

#import <OneSignal/OneSignal.h>
....
 (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification
{
  if([self pushAvailable]) {
    [RCTPushNotificationManager didReceiveRemoteNotification:notification];
    [RCTOneSignal didReceiveRemoteNotification:notification];
 }
}

All the steps are described here:

https://www.npmjs.com/package/react-native-onesignal#add-notification-service-extension

Old answer

For react-native-onesignal versions <= 3.0.7

  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

Run clean build before build.

Sources:

https://github.com/geektimecoil/react-native-onesignal/issues/19 https://github.com/geektimecoil/react-native-onesignal/issues/18

Upvotes: 0

heloisasim
heloisasim

Reputation: 5016

Try to update to onesignal 2.0 with the command pod repo update

Upvotes: 2

Related Questions