Guide for setting up your IOS project

Here’s a streamlined guide for setting up your project:

1. Check Project Folders:
– Navigate to your project directory and locate the android and ios folders.

2. Open Terminal:
– Open the terminal in your project folder location.

3. Install Dependencies:
– Run the command: yarn install to install all dependencies.

4. Update Dependencies:
– After installation, check and update any outdated packages.

5. Install CocoaPods (iOS only):
– Navigate to the ios folder.
– Install CocoaPods by following the tutorials:
– [React Native Setup](https://reactnative.dev/docs/set-up-your-environment)
– [CocoaPods Installation Guide](https://guides.cocoapods.org/using/getting-started.html#installation)

6. Follow Video Tutorial:
– Refer to this video for guidance: [Setup Tutorial](https://www.youtube.com/watch?v=O5K0c6_xScw&t=127s)

7. Install and Link Push Notification Library:
– Install and link react-native-push-notification/ios by following the instructions here:
– [Library GitHub Page](https://github.com/react-native-push-notification/ios)

8. Run pod-install:
– Execute npx pod-install in the terminal.
– Address any errors as needed. Solutions for common issues can be found here: [Error Solutions](https://awxdocs.com/tutorials/errors-and-solutions)

9. Open Project in Xcode:
– Double-click the {project_name}.xcworkspace file in the ios folder to open it in Xcode.

10. Configure Push Notifications in Xcode:
– In the Xcode project navigator, select your project (root folder).
– Under the Targets section, select your app target.
– Go to the “Signing & Capabilities” tab.
– Add the “Push Notifications” capability:
– Click the + Capability button.
– Add “Background Modes” and check “Remote Notifications.”
– Add “Push Notifications.”
– Use the correct team under the Signing section, matching your Apple Developer account.

11. Update AppDelegate.h:
– At the top of the file, add:

– Update the AppDelegate interface:

12. Update AppDelegate.m:
– Add the following methods:

 

13. Update Build Settings in Xcode:
– In Xcode, select {project_name} and go to “Build Settings.”
– Locate “Search Paths.”

– Select “Library Search Path”.

– Drag “inherited” to the bottom of the list by clicking on the <Multiple Values> option.

14. Build and Run:
– Build and run the project as needed.

This guide should help you set up your project efficiently!

Updated on Sep 30, 2024