Install the iOS Core Framework for the Customer App | Zoho Creator Help

iOS core framework

This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version.
The core framework of Creator's iOS SDK allows you to create a custom UI  and build an iOS app using the data present in your Creator application.

Prerequisites

Note: M1 Mac users should run Xcode with Rosetta enabled.

Register your iOS app with Zoho

Registering your iOS app with Zoho generates a  Client ID  and  Client Secret  combination. These are required to allow your iOS app to integrate with your Creator application. To register your iOS app with Zoho:

  1. Navigate to  Mobile  section on the left pane and click the  SDK  tab.
  2. Click on the required row of the iOS app for which you want to configure the core framework. The  For Customer - SDK  pane will open on the right.

  3. Click  Generate Client .

  4. This will generate the  client ID client secret Portal ID,  and  redirectURI  for the iOS app that you want to integrate with your Creator application.

  5. Downloaded the  ZCAppInfo.plist  file and add it to your project.

Install the iOS core framework for the customer app

  1. Install the Zoho Creator SDK using Pod:
    target 'Demo' do
    use_frameworks!
    pod 'ZohoPortalAuth'
    pod 'ZCCoreFramework'
    end
    post_install do |installer|
    installer.generated_projects.each do |project|
    project.targets.each do |target|
    target.build_configurations.each do |config|
    config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
    end
    end
    end
    end
  2. Add the following to your Objective-C bridging header:
    #import <ZohoPortalAuthKit/ZohoPortalAuth.h> 
  3. Import ZCCoreFramework to use Zoho Creator's SDK's iOS core framework:
    import ZCCoreFramework
  4. Configure your project with the following code, for example in the SceneDelegate file:
    class SceneDelegate: UIResponder, UIWindowSceneDelegate {
     var window: UIWindow ?
    
      func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
       if let windowScene = scene as? UIWindowScene {
        let window = UIWindow(windowScene: windowScene)
       }
       let scope = ["aaaserver.profile.READ","zohocontacts.userphoto.READ","ZohoContacts.contactapi.READ","ZohoCreator.meta.CREATE","ZohoCreator.meta.READ","ZohoCreator.meta.UPDATE","ZohoCreator.meta.DELETE","ZohoCreator.data.CREATE","ZohoCreator.data.READ","ZohoCreator.data.UPDATE","ZohoCreator.data.DELETE","Stratus.stratusop.READ","ZohoCRM.modules.READ","ZohoCRM.users.READ"]
       let clientID = "<Your Client ID>"
       let clientSecret = "<Your Client Secret>"
       let portalId = "<Your Portal ID>"
       let urlScheme = "<Your Url Scheme>"
       let accountsUrl = "https://accounts.zohoportal.com" // enter the accounts URL of your respective DC. For eg: EU users must use 'https://accounts.zohoportal.eu'
       ZohoPortalAuth.initWithClientID(clientID, clientSecret: clientSecret, portalID: portalId, scope: scope, urlScheme: urlScheme, mainWindow: self.window!, accountsPortalURL: accountsUrl)
    
       // To verify if the app is already logged in
    
       ZohoPortalAuth.getOauth2Token {
        (token, error) in
        if token == nil {
         // Not logged in
         self.showLoginScreen()
        } else {
         // App logged in already.
         // Ensure to use the following line of code in your iOS app before you utilize any of Creator SDK’s methods
         Creator.configure(delegate: self)
        }
       }
      }
    
     func scene(_ scene: UIScene, openURLContexts URLContexts: Set <UIOpenURLContext> ) {
      if let context = URLContexts.first {
       let _ = ZohoPortalAuth.handleURL(context.url,
        sourceApplication: context.options.sourceApplication,
        annotation: context.options.annotation)
      }
     }
    }
    
    extension SceneDelegate: ZCCoreFrameworkDelegate {
     func oAuthToken(with completion: @escaping AccessTokenCompletion) {
      ZohoPortalAuth.getOauth2Token {
       (token, error) in
       completion(token, error)
      }
     }
    }

    Code to add Zoho Portal login to your iOS app:
    func showLoginScreen() {
     ZohoPortalAuth.presentZohoPortalSign( in: {
      (token, error) in
      if token != nil {
       //login success
      }
     })
    }

    Code to provision logout from Zoho Portal:
    func logout() {
     ZohoPortalAuth.revokeAccessToken {
      (error) in
      if error == nil {
       //Logout Successfully
      }
      else {
       //Error Occurred
      }
     }
    }

FAQ

  1. I'm a M1 Mac user and I'm facing issues while adding dependencies. What should I do?
    To proceed further, please use the arch=x86_64 pod install command.

References

  • Please refer to our  iOS SDK documentation  for detailed information about the various SDK methods.
  • Familiarize yourself with Mobile SDK for iOS by trying out our sample application  here .
  • To configure push notifications for iOS, refer  here .

Users

Customers


    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION





                        Still can't find what you're looking for?

                        Write to us:  support@zohoforms.com


                              



                            



                          Manage your brands on social media




                              Zoho Marketing Automation

                                Zoho Sheet Resources

                                 




                                    Zoho Forms Resources


                                      Secure your business
                                      communication with Zoho Mail


                                      Mail on the move with
                                      Zoho Mail mobile application

                                        Stay on top of your schedule
                                        at all times


                                        Carry your calendar with you
                                        Anytime, anywhere




                                              Zoho Sign Resources

                                                Sign, Paperless!

                                                Sign and send business documents on the go!

                                                Get Started Now




                                                        Zoho TeamInbox Resources



                                                                Zoho DataPrep Resources



                                                                  Zoho DataPrep Demo

                                                                  Get a personalized demo or POC

                                                                  REGISTER NOW


                                                                    Design. Discuss. Deliver.

                                                                    Create visually engaging stories with Zoho Show.

                                                                    Get Started Now










                                                                                          • Related Articles

                                                                                          • iOS core framework

                                                                                            This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. The core framework of Creator's iOS SDK allows you to create a custom UI and build an iOS app using the data present in your ...
                                                                                          • iOS UI framework

                                                                                            This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. The UI framework offers predefined view controllers for the components in your Creator application in addition to the ...
                                                                                          • iOS UI framework

                                                                                            This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. In addition to the capabilities of the core framework, the UI framework offers predefined view controllers for the ...
                                                                                          • iOS SDK

                                                                                            This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. Mobile Software Development Kits (mobile SDK) provide a set of software development tools that allow for a wide range of ...
                                                                                          • Android core library

                                                                                            This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. The core library of Zoho Creator's Android SDK allows you to create custom UI and build an Android app using the data ...
                                                                                          Wherever you are is as good as
                                                                                          your workplace

                                                                                            Resources

                                                                                            Videos

                                                                                            Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                            eBooks

                                                                                            Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                            Webinars

                                                                                            Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                            CRM Tips

                                                                                            Make the most of Zoho CRM with these useful tips.



                                                                                              Zoho Show Resources