IOS documentation (auther : - kakshap Gavde )

iOS Documentation 

 IOS build run project : - 

1. Clone repository in vsCode 

2. Go to project folder and do npm install 

3. After successfully installation, go to iOS folder ie: cd ios 

4. Do pod install 

5. Now go to ios folder of project, there must be <ProjectName>.xcworkspace folder.

6. Right click on <ProjectName>.xcworkspace => select option “reveal in finder” => double click to open (This will open your project automatically in Xcode). 

7. After Xcode is open you will see available devices on which app can be run. Select one available device

8. Run project. (This will run app in selected simulator or real device).

To change build configuration options (debug/release):

1. Go to Product option in top menu

2. Select Scheme

3. Select Edit scheme

4. Go to Run option

5. Change build configuration(debug/release)

 

Facing problems with pod: - 

1. Clean the project build folder.  

            Product =>  click on Clean Build Folder

2. Delete derived data folder. 

            Xcode => Preferences => Locations => Derived data - click on arrow          ‘->’ and then delete derived data folder

3. Close Xcode

4. Delete node modules and close vscode ie: (if required restart the system)

5. Open vscode  

7. Run npm install 

8. Run cd ios and pod install  

9. Open <ProjectName>.xcworkspace file in Xcode. 

10. Run the project (by clicking on Run button). 

 

Libraries integration: - 

There is no need to manually link packages as now react native auto link all packages.

But still if needs to manually link any package, follow below steps-

To manually link libraries (If package is Not integrated with project or Not linked with project)

            1. Open Xcode

            2. Go to Libraries folder in left panel (Right click on it)

            3.  Select Add files to <ProjectName>

            4. New popup will appear containing files inside iOS folder. Just click                              on Options

            5. Select <ProjectName>

            6. Go to node  modules and find the package you want to integrate

            7. Inside that package, there must be <packagename>.xcodeproj file

            8. Select that .xcodeproj file and click on Add

            9. Now you will see that <packagename.xcodeproj> is added in                                            Libraries folder on left panel

            10. Go to that package, you will see one Products folder(This will                                contain one <packagename>.a file)

                         ie: Libraries => <packagename>.xcodeproj => Products =>                         <packagename>.a file

                        <packagename>.a file is statically linked library file which needs                 to be linked

            11. Now go to projects Build Phases section

            12. Open Link Binary With Libraries.

13. Drag and drop that .a file into ‘Link Binary with Libraries’

                        Or

                  Click on the “+” under “Link Binary with Libraries” to add that                                            statically linked library file ie: <packagename>.a

                         Navigate to the static library file (. a) and add it

             14. If In case file is not found then do “npm install” and “pod install”                                                => again follow the same steps above

 

Ref:- https://www.chilkatsoft.com/xcode-link-static-lib.asp 

 

Creating .ipa file (To build app and use it on real device): - 

Make sure you haven’t selected any specific simulator (If selected then it will not allow Archive option under Product tab)

            Deselect if any simulator (select option “any iOS device”)

            1. Go to Product option in top menu

            2. Clean build folder

            3. Go to Product and select Build

            4. Go to Product and select Archive

            5. After successfully Archive then click the Distribute App button on                                right panel

            6. Select Development (Distribute to members of your team) (Select                                   App Store Connect incase of distributing app to TestFlight and                                 App Store)

            7. Development distribution options window will be open

                        In App Thinning option select All compatible device variants

            8. Signing screen will be shown

                        Select Automatically manage signing

            9. Select Export

            10. Select your location where you need to save .ipa file (You can also                       change name of .ipa file if you want)

            11. Select Export

           

 

12.Go to your selected folder directory location (.ipa file is available                                            to share)

 

            Ref:-https://stackoverflow.com/questions/5499125/how-to-create-ipa-file-using-xcode

 

Creating Certificates,Identifiers & Profiles:-

1. Go to developer.apple.com

2. Click on Account section in header menu

3. Login with apple credentials (Sign in with apple developer)

4. Open Certificates,Identifiers & Profiles from left panel

           

            Certificates:-

            5. Click on Certificates “+” icon

            6. Create a new certificate page will open, Select iOS App                                        Development

            7. Click on Continue 

            8. Upload a Certificate Signing Request file

                        For this we will first need to create certificate signing                                                           request

                        a. Go to Keychain Access from your launchpad                                                                                     (MacBook)

                        b. Click on Keychain Access from top menubar

                        c. Select Certificate Assistant

                        d. Select Request a Certificate From a Certificate                                                                                     Authority

                        e. Certificate information popup will open, enter Email                                                             address and select Saved to disk

                        f. Click on Continue and select the folder where you                                                                 want to save certificate locally

                        g. Certificate is available in your selected folder (It is                                                                ready to upload)

           

9. After uploading the above created certificate, click Continue

            10. Now your certificate is created which can be downloaded

           

            Identifiers:-

            5. Click on Identifiers “+” icon

            6. Register a New Identifier page will open, Select App IDs

            7. Select Capability (If are added in your app eg- Sign in with apple,                                       Push notification, etc)

            8. Click on Continue

            9. Register an App ID page will open, Add description for your app

                        And also add Bundle ID (eg: com.xyz)

            10. Click on Continue

            11. Click on Register

            12. Bundle identifier is created

 

            Profiles:-

            5. Click on Profiles “+” icon

            6. Generate a Provisioning Profile page will open, Select Ad Hoc or                                         App Store

                        Ad Hoc- Create a distribution provisioning profile to install your                                              app on a limited number of registered devices

                        App Store- Create a distribution provisioning profile to submit                                                    your app to the App Store

            7. Click on Continue

            8. Select App Id

            9. Click on Continue

            10. Select Certificate

            11. Click on Continue

            12. Add Provisioning Profile Name (any unique name)

            13. Click on Generate

            14. Provisioning Profile is created

 

 

            Devices:-

            5. Click on Devices “+” icon or Register a Device

            6. Enter Device name

            7. Enter Device Id (UDID)

                        Your UDID is a unique identifier that Apple uses to associate a                                  device to an iOS developer account so that developers can                                     install and test their apps before releasing them

                        ref-https://www.sourcefuse.com/blog/how-to-find-udid-in-the-new-iphone-xs-iphone-xr-and-iphone-xs-max/

            8. Click on Continue

            9. Click on Register

            10. Device is added

 

Issue and Solution: - 

1.For double-conversion/double-conversion.h file not found issue               -https://github.com/facebook/react-native/issues/26405#issuecomment-530674386 

2. library not found for -lDoubleConversion                                                                         -https://stackoverflow.com/a/28111728 

3. While updating pod always delete pod.lock first to avoid ambiguity. 

4. To make version specific changes add version no. to pod file along with the pod.lock. 

 

Helpful links: - 

1.https://blog.pusher.com/debugging-react-native-ios/ 

2.https://clearbridgemobile.com/how-to-submit-an-app-to-the-app-store/ 

3.https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-overview

4.https://github.com/react-native-push-notification-ios/push-notification-ios  (push notification iOS integration)documentation should be followed strictly 

 

 

5.react-native-azurenotificationhub/ios-installation.md at 606d7139f3066c55f23208149b514befde4009bb ·CatalystCode/react-native-azurenotificationhub · GitHub 

6.https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html 

7.https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification 

8.https://rnfirebase.io/screencasts/ios-installation

9.https://rnfirebase.io/

10.https://rnfirebase.io/messaging/usage/ios-setup

12 : 

https://github.com/facebook/react-native/issues/36635    DatapickerIOs


VAlue is no defined it was introduce in iphone 12

pod > change iphone targets for all pods less than 12 to 12 in xcode  Link



React Native: error | DatePickerIOS not found Link