Code Monkey home page Code Monkey logo

crisp-sdk-ios's Introduction

Crisp

Chat with app users, integrate your favorite tools, and deliver a great customer experience.

Crisp iOS SDK

Crisp screenshot

CocoaPods Carthage Compatible Twitter

Installation

Cocoapods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate Crisp into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Crisp'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Crisp into your Xcode project using Carthage, specify it in your Cartfile:

github "crisp-im/crisp-sdk-ios"

Run carthage update to build the framework and drag the built Crisp.framework into your Xcode project.

Ensure you embed binaries

Embed binaries

Requirements

โš ๏ธ Adding Camera and Photo permissions is mandatory, NSCameraUsageDescription and NSPhotoLibraryUsageDescription in Info.plist, to inform your users that you need to access to the Camera and Photo Library. You also have to enable "iCloud Documents" capability

Get your website ID

Your website ID can be found in the Crisp App URL:

Crisp Website ID is an UUID like e30a04ee-f81c-4935-b8d8-5fa55831b1c0

Usage (Swift)

Start using Crisp by adding the following code on your AppDelegate :

import Crisp
Crisp.initialize(websiteId: "YOUR_WEBSITE_ID")

You can add the Crisp view by adding in your view CrispView() :

import UIKit
import Crisp

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let crispView = CrispView()
        crispView.bounds = view.bounds
        crispView.center = view.center

        view.addSubview(crispView)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
}

Usage (Objective C)

Start using Crisp by adding the following code on your AppDelegate :

#import "Crisp-Swift.h"

[[CrispMain alloc] initializeWithWebsiteId:@"YOUR_WEBSITE_ID"];

You can add the Crisp view by adding in your view CrispView() :

#import "Crisp-Swift.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    CrispView *crispView = [[CrispView alloc] init];
    crispView.bounds = self.view.bounds;
    crispView.center = self.view.center;
    
    [self.view addSubview:crispView];
}

API Usage (Swift):

  • Crisp.tokenId = "XXXX" sets your own token_id
  • Crisp.locale = "it" Overrides the Crisp locale with a custom one
  • Crisp.user.set(email: "[email protected]");
  • Crisp.user.set(nickname: "John Doe");
  • Crisp.user.set(phone: "003370123456789");
  • Crisp.user.set(avatar: "https://pbs.twimg.com/profile_images/782474226020200448/zDo-gAo0_400x400.jpg");
  • Crisp.session.set(data: ["key" : "value"]);
  • Crisp.session.set(segment: "segment");
  • Crisp.session.set(segments: ["segment1", "segment2"]);
  • Crisp.session.pushEvent(name: "signup", ["key" : "value"], "blue");
  • Crisp.session.reset();

API Usage (Objective C ):

UserInterface *user = [[UserInterface alloc] init];
[user setWithEmail:@"[email protected]"];
[user setWithNickname:@"John Doe"];
[user setWithPhone:@"003370123456789"];
[user setWithAvatar:@"https://pbs.twimg.com/profile_images/782474226020200448/zDo-gAo0_400x400.jpg"];

SessionInterface *session = [[SessionInterface alloc] init];

NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject: @"Value"  forKey: @"Key"];

[session setWithData:dict];
[session setWithSegment:@"segment"];
    

Credits

Crisp iOS SDk is owned and maintained by Crisp IM, SARL. You can chat with us on crisp or follow us on Twitter at Crisp_im

License

Crisp iOS SDk is under Copyright license. see LICENSE for more details.

crisp-sdk-ios's People

Contributors

baptistejamin avatar johneschwoopf avatar qdequele avatar sandoruk avatar valeriansaliou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.