Skip to content

Commit

Permalink
Release v2.4.1 (#165)
Browse files Browse the repository at this point in the history
* Updated podspec

* Example projects updated

* Build artifacts updated

* Project updated with new artifcats

* Changelog updated
  • Loading branch information
iamsimranjot authored Apr 4, 2020
1 parent 470d712 commit 88d2aa7
Show file tree
Hide file tree
Showing 68 changed files with 1,082 additions and 908 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.4.1] - (03/04/20) - F iOS

### Features

### Enhancements
- Shared utilities made thread safe
- Haptik branding image updated

### Bugs
- Fixes navigation items showing wrong tint color
- Fixes background task error in CoreData.

---

## [2.4.0] - (26/03/20) - E iOS

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import UserNotifications;

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

// If you need the callbacks of the analytics data that haptik sends
Expand Down Expand Up @@ -63,14 +63,14 @@ extension AppDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {

// Check if the notification received belongs to haptik and take action accordingly

let userInfo = response.notification.request.content.userInfo as! [String : Any]
let isHaptikNotification = Haptik.sharedSDK().canHandleNotification(userInfo: userInfo)

if isHaptikNotification {

print("Do Housekeeping")
handleNotificationInteraction(userInfo)
}
Expand Down Expand Up @@ -103,10 +103,10 @@ extension AppDelegate {

HPConfiguration.shared().themeConfig = HPThemeService.build { (builder) in

builder?.brandColor = UIColor(hexString: "#2196f3")
builder?.businessChatBackground = UIColor(hexString: "#f0f0f0")
builder?.businessChatText = UIColor(hexString: "#333333")
builder?.messageTimeStamp = UIColor(hexString: "#777777")
builder?.brandColor = UIColor(hexString: "#0050ddff")
builder?.businessChatBackground = UIColor(hexString: "#f0f0f0ff")
builder?.businessChatText = UIColor(hexString: "#333333ff")
builder?.messageTimeStamp = UIColor(hexString: "#777777ff")

builder?.lightFont = "HelveticaNeue-Light"
builder?.regularFont = "HelveticaNeue"
Expand All @@ -123,7 +123,7 @@ extension AppDelegate {
extension AppDelegate: HPAnalyticsServiceDelegate {

func eventTracked(_ eventName: String, forParams params: [AnyHashable : Any]?) {

// Get all the events tracked here
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import UIKit
import HaptikLib
import HaptikBase

class RootViewController: UIViewController {

// MARK: Outlets & Attributes

@IBOutlet weak var signupBtn: UIButton!
Expand All @@ -27,54 +28,29 @@ class RootViewController: UIViewController {

// MARK: Actions

@IBAction func signupTapped(_ sender: UIButton) {
@IBAction func openHaptikChat(_ sender: UIButton) {

if Haptik.sharedSDK().isUserSignedUp() {

// Option A

/*Haptik.sharedSDK().launchChannel(with: "channel_via_name",
message: "any_message_you_wanna_start_With",
controller: self);*/

// Option B

let conversation = try? Haptik.sharedSDK().getConversationFor(viaName: "channel_via_name", launchMessage: "message_to_be_sent_from_user_side", hideLaunchMessage: false)
if let conversation = conversation {
present(conversation, animated: true, completion: nil)
}
triggerSignedUpFlow()
}
else {

loadingIndicator.startAnimating()
signupBtn.isHidden = loadingIndicator.isAnimating

let signupObject = HPSignUpObject.build(withAuthType: "basic") { (builder) in
triggerSignInFlow {[unowned self] (conversation, error) in

builder.userFullName = "Simranjot"
builder.viaName = "channel_via_name"

// You can set more properties on the builder according to the requirements
}

Haptik.sharedSDK().signUp(with: signupObject) { [unowned self] (success, initialVC, error) in

if success {

let deviceToken = UserDefaults.standard.object(forKey: "kDeviceToken") as! Data
Haptik.sharedSDK().setDeviceToken(deviceToken)
if let _ = error {

// From here you can either push to the specific conversation controller if you pass in the via name in the builder
if let initialVC = initialVC {
self.present(initialVC, animated: true, completion: nil)
}
else {
// Handle Error here
}
// Handle error here ...
return;
}
else {

// Handle Error here

self.setDeviceToken()

if let conversation = conversation {
self.presentHaptikConversation(conversation)
}

self.loadingIndicator.stopAnimating()
Expand All @@ -84,3 +60,62 @@ class RootViewController: UIViewController {
}
}


// MARK: Haptik Helper Extension

extension RootViewController {

func triggerSignedUpFlow() {

// Option A

/*Haptik.sharedSDK().launchChannel(with: "channel_via_name",
message: "any_message_you_wanna_start_With",
controller: self);*/

// Option B

let conversation = try? Haptik.sharedSDK().getConversationFor(viaName: "reminderschannel",
launchMessage: "",
hideLaunchMessage: false)
if let conversation = conversation {
presentHaptikConversation(conversation)
}
}

func triggerSignInFlow(completion: @escaping(_ conversation: UIViewController?, _ error: Error?) -> Void) {

// Make the signup object which contains the required information used for signup
let signupObject = HPSignUpObject.build(withAuthType: "basic") { (builder) in

builder.userFullName = "Simranjot"
builder.viaName = "reminderschannel"

// You can set more properties on the builder according to the requirements
}

Haptik.sharedSDK().signUp(with: signupObject) { (success, initialVC, error) in
completion(initialVC, error);
}
}

func presentHaptikConversation(_ conversationVC: UIViewController) {

let navigationController = UINavigationController(rootViewController: conversationVC)

HPConfiguration.shared().configureNavigationBarTintColor(UIColor(hexString: "#0050ddff"),
navigationItemTintColor: .white,
makeTranslucent: false,
for: navigationController)

present(navigationController, animated: true, completion: nil)
}

func setDeviceToken() {

let deviceToken = UserDefaults.standard.object(forKey: "kDeviceToken") as? Data
guard let token = deviceToken else { return }
Haptik.sharedSDK().setDeviceToken(token)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,100 @@
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "haptik_120.png",
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "haptik_180.png",
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "haptik_1024.png",
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"images" : [
{
"filename" : "Logo-Tagline horizontal.png",
"idiom" : "universal",
"filename" : "haptik_textlogo.pdf",
"scale" : "1x"
},
{
Expand All @@ -15,7 +15,7 @@
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading

0 comments on commit 88d2aa7

Please sign in to comment.