Skip to content

Pointzi (iOS 11+) Setup

Due to lack of support of features like SwiftUI, Combine framework in iOS 11 new features will only be added to the iOS 13+ version of Pointzi. If you need any support on iOS 11+ version of Pointzi don’t hesitate in contacting us at support@pointzi.com .

Requirements

  • iOS 11.0 and above.
  • Latest Xcode.

This setup assumes you have already setup your App Key on the Dashboard.

See requirements.

CocoaPod Integration Steps

In pod file of your Application, add the following line:

platform :ios,'11.0' # or above
pod "pointzi"
On the first time, run:
pod install
For updates and ensuring to get the latest version of the pointzi SDK, run:
pod update
This installs pointzi binary and dependencies.

Note

If you have used cocoapods previously, please run either "pod update" or "pod update pointzi --no-repo-update", this will ensure that the most recent version of the Pointzi SDK is integrated.

If you are using Swift, add :

#import "StreetHawkCore_Pointzi.h"
in your Swift bridge header file <Your_Project_Name>-Bridging-Header.h.

In your Application launch function, add pointzi registration.

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
    {
        // Replace 'MyApp' with your app_key, registered in the Pointzi Dashboard.
        Pointzi.sharedInstance().registerInstall(forApp: "MyApp", withDebugMode: false)
        // Set 'withDebugMode' to 'true' to enable debug logging.
        return true
    }
}
#import "StreetHawkCore_Pointzi.h"


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Replace 'MyApp' with your app_key, registered in the Pointzi Dashboard.
    [POINTZI registerInstallForApp:@"MyApp" withDebugMode:NO];
    // Set 'withDebugMode' to 'YES' to enable debug logging.
    return YES;
}

Replace the base ViewController classes and inherit from Pointzi SDK classes as shown below.

From To
UITableViewController StreetHawkBaseTableViewController
UIViewController StreetHawkBaseViewController
UICollectionViewController StreetHawkBaseCollectionViewController

For React Native, In your AppDelegate.m , Replace UIViewController with StreetHawkBaseViewController

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  //Replace UIViewController with StreetHawkBaseViewController
  UIViewController *rootViewController = [StreetHawkBaseViewController new];
}

Info

If your view controller overrides system functions, make sure you call super.

Info

Replacing your view controller with the Pointzi controller is essential for Pointzi to function correctly. Please ensure that if you have multiple view controllers showing on the same screen to only replace the parent (top ViewController).

We recommend you also send a unique ID for the user so you can "tag" users from backend system. This is called the sh_cuid.

To do this place, the following snippet just after your registration and login calls.

//unique id in your system, for example customer's login id
Pointzi.sharedInstance().tagCuid("user@example.com")
//unique id in your system, for example customer's login id
[POINTZI tagCuid:@"user@example.com"];

Without Cocoapod

Dependencies

Before you can integrate the Pointzi Framework you need to include the following libraries and frameworks in your project.

  • libxml2.dylib
  • UIKit
  • libsqlite3
  • CoreTelephony
  • Foundation
  • CoreGraphics
  • CoreSpotlight

Tip

Click "+" button of section Linked Frameworks and Libraries on general tab of your target to add the libraries.

Note

If your app is a swift project, please make sure you add -ObjC into your app target's Other Linker Flags under Build Settings.

Dynamic Framework

  • Download and extract [pointzi-framework-1.6.6.zip] (https://repo.pointzi.com/sdk/pointzi/ios/1.6.6/1.6.6/pointzi-framework-1.6.6.zip).
  • Drag & drop StreetHawkCore_Pointzi.framework into your app project.
  • Go to the target general tab.
  • Add the Pointzi framework to the Embedded Binaries
  • Download the resources corresponding to the resource bundle Pointzi.bundle to the same path as the framework.
  • Add this resource using Copy Bundle Resources option under Build Phases of your app target.
  • Now you should be able to call Pointzi api by importing headers like
#import <StreetHawkCore_Pointzi/StreetHawkCore_Pointzi.h>

Static Library

  • Download and extract [pointzi-1.6.6.zip] (https://repo.pointzi.com/sdk/pointzi/ios/1.6.6/1.6.6/pointzi-1.6.6.zip).
  • Drag & drop the Pointzi folder into your app project.
  • Ensure you added libPointzi.a in the folder into your app target Link Binary With Libraries under tab Build Phases.
  • Download the resource corresponding to the resource bundle Pointzi.bundle to the same path of framework (or just add resources from folder assets into Build Phases).
  • Add this resource using Copy Bundle Resources option under Build Phases of your app target.
  • Now you should be able to call Pointzi api by importing headers like.
#import "StreetHawkCore_Pointzi.h"