Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]: How to add iOS Service Extensions ('OneSignal/OneSignal.h' file not found) #1196

Closed
1 task done
IgorSamer opened this issue Dec 28, 2022 · 1 comment
Closed
1 task done

Comments

@IgorSamer
Copy link

How can we help?

I'm migrating my Ionic + Capacitor 2 app to Capacitor 4 but I'm having trouble configuring the iOS Service Extensions using OneSignal.

I'm following all the steps described in https://documentation.onesignal.com/docs/ionic-sdk-setup#step-5-configure-your-xcode-project-ios-only however, Xcode always shows the error 'OneSignal/OneSignal.h' file not found.

After each failed attempt, I deleted the iOS platform folder and recreated it using ionic capacitor add ios to be able to redo the attempts in a completely clean code and thus avoid possible conflicts, but I always get the same problem.

These are exactly the steps I'm doing:

  1. ionic capacitor add ios (recreating the iOS project after deleting it)
  2. xed ios/App (in Capacitor 4 this is the project structure)
  3. Enable Push Notifications and Remote Notifications (inside of Background Modes) in Signing & Capabilities
  4. Go to File > New > Target..., insert the name OneSignalNotificationServiceExtension, select Objective-C as language and then click on Finish and then Cancel
  5. With OneSignalNotificationServiceExtension selected in the target list, I select the Deployment Target as iOS 13 (just like I'm using in the Main Application Target)
  6. Open the NotificationService.m file inside the newly created OneSignalNotificationServiceExtension folder and then replace all its contents with Objective-C code
  7. Select the OneSignalNotificationServiceExtension target, enter the Build Settings tab and make sure that the values of Debug and Release within Code Signing Entitlements are already blank
  8. Close Xcode
  9. Open ios/App/Podfile
  10. Include the following code at the end of Podfile:
target 'OneSignalNotificationServiceExtension' do
    pod 'OneSignalXCFramework', '>= 3.0.0', '< 4.0'
end
  1. Return to the terminal and then pod repo update and pod install, which returns the following:
Analyzing dependencies
Downloading dependencies
Installing OneSignalXCFramework 3.12.3
Generating Pods project
Integrating client project
Pod installation complete! There are 23 dependencies from the Podfile and 33 total pods installed.
  1. xed ios/App and wait for Xcode to open and index files
  2. Keep getting the error 'OneSignal/OneSignal.h' file not found

As I already said I've followed every single step in https://documentation.onesignal.com/docs/ionic-sdk-setup#step-5-configure-your-xcode-project-ios-only and redone these steps numerous times until I came to the conclusion that I didn't make any mistakes and followed all the steps as recommended, so how can I resolve this?

Thanks!

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pettomartino
Copy link

@IgorSamer did you find a solution to this problem? I run into the same issue can't find a solution.

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

No branches or pull requests

3 participants