Giter VIP home page Giter VIP logo

chabok-client-ios's Introduction

Chabok Push for iOS

Cocoa-pods Cocoa-pods

Blow some breath into your app with Chabok realtime messaging and receive push notifications across all platforms with zero code. Know your users better, push them the content based on their location or track their presence/location without headache.

Installation

See ChabokPush iOS Framework installation document.

API

See ChabokPush Usage page for a list of all available methods.

Release Note

You can find release note here.

Support

Please visit Issues.

chabok-client-ios's People

Contributors

alimate avatar behrad avatar hos7ein avatar husseinhj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chabok-client-ios's Issues

I have done every thing but it does not work

hi
i do every thing based on your doc and sample project but i cant connect to server and all i got in console is : URL: "cydia://package/com.example.package" - error: "This app is not allowed to query for scheme cydia"
i added Allow Arbitrary Loads to true but still it does not fixed

-[PushClientManager userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:]: unrecognized selector sent to instance

Hi,
Quite often we see crash in AppDelegate with no reason.
I think this will happen after receiving some push notifications.

here is the log of crash

2017-12-17 17:13:59.682185+0330 shahrvand[8121:3137230] -[PushClientManager userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:]: unrecognized selector sent to instance 0x10bd123c0
2017-12-17 17:13:59.741200+0330 shahrvand[8121:3137230] invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.
2017-12-17 17:14:04.737711+0330 shahrvand[8121:3137230] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PushClientManager userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:]: unrecognized selector sent to instance 0x10bd123c0'
*** First throw call stack:
(0x1822b2364 0x1814f8528 0x1822bf828 0x1822b7a1c 0x18219cecc 0x104bd2a90 0x104bd2dc8 0x18ba080f8 0x18c419798 0x18c419674 0x18c1872dc 0x18c3203dc 0x18c18718c 0x18bf6b78c 0x18be0d2d4 0x184976ca4 0x1086f928c 0x1087059e4 0x1849aa7f8 0x1849aa49c 0x1849aaa38 0x18225a97c 0x18225a8fc 0x18225a184 0x182257d5c 0x182177e58 0x184024f84 0x18b7f767c 0x104bd42e4 0x181c9456c)
libc++abi.dylib: terminating with uncaught exception of type NSException

and this is my userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:

func userNotificationCenter(_ center: UNUserNotificationCenter,
                            didReceive response: UNNotificationResponse,
                            withCompletionHandler completionHandler: @escaping () -> Void) {
    let userInfo = response.notification.request.content.userInfo
    self.manager?.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)
    completionHandler()
}

Can't Get Notifications When App Is Closed

Hi ,
I Did Done Everything Explained On The Documentations For IOS Devices In The Apple Developer Center , XCode , ...

I Get Notifications When App is In Background or Is In Foreground , But When App Is Closed No Notification Is Received !

Any Suggestions ?!

test push in debug mode

push notification just works in release versions and i need to test push notifications in debug mode (to get data and ...) !
is there any way to do it ?

Getting notification with Data

I want to get Data from notification , but it does not work correctly and leads the app to crash
What should i do ?

The Error :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'unable to serialize userInfo: Error Domain=NSCocoaErrorDomain Code=3851 "Property list invalid for format: 200 (property lists cannot contain objects of type 'CFNull')" UserInfo={NSDebugDescription=Property list invalid for format: 200 (property lists cannot contain objects of type 'CFNull')}'
*** First throw call stack:
(0x182c3ed8c 0x181df85ec 0x18d12e6f8 0x100b2a058 0x100b28320 0x100b33e2c 0x100b4c388 0x100b4bf24 0x100b1da64 0x182b77b34 0x182b83554 0x182b7762c 0x1832b172c 0x1832b6ee4 0x1832b2d58 0x182bed9f4 0x182be7404 0x182be6c2c 0x182be479c 0x182b04da8 0x184aea020 0x18cb24758 0x100ae78f0 0x182595fc0)
libc++abi.dylib: terminating with uncaught exception of type NSException

دلیل نمایش دوباره ناتیف هنگام باز شدن اپ چیست؟

من با تنظیمات پیشفرض چابک را روی پروژه پیاده کردم. هنگامی که برنامه بسته است و روی ناتیف تپ می شود٬ برنامه باز می شود اما پس از باز شدن دوباره همان ناتیف دریافت می شود. اگر این ناتیف ها زیاد باشد بسیار زننده می شود و تمام ناتیف ها دوباره اعلان میشوند. آیا برای جلوگیری از این مورد نیاز به تنظیمات خاصی هست؟

PushClientManagerDelegate methods not being called

Hi,
As the Chabok doc says, I have registered user at Chabok when the apple push notification permission dialog needed to be shown. here is the code (in first ViewController after showing some message about push notification):

let userId = User.currentUser?.id ?? generateRandomId()
(UIApplication.shared.delegate as? AppDelegate)?.manager?.registerUser(userId)

And here is my AppDelegate didFinishLaunchingWithOptions func:

self.manager = PushClientManager.default()
PushClientManager.setDevelopment(isDebug)
manager?.registerApplication(ChabokCredentialInfo.appID, apiKey: ChabokCredentialInfo.sdkKey, userName: ChabokCredentialInfo.username, password: ChabokCredentialInfo.password)
manager?.addDelegate(self)
manager?.enableLocationOnLaunch = true

And other AppDelegate function as Chabok doc says:

func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
    self.manager?.application(application, didReceive: notification)
}

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
    self.manager?.application(application, didReceiveRemoteNotification: userInfo)
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
    self.manager?.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
}

func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {
    self.manager?.application(application, didRegister: notificationSettings)
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    print("APNs token retrieved: \(deviceToken as NSData)")
    self.manager?.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
}

So here is the problem, with this configs and registration flow, every push notification is being arrived from the APNs channel, not Chabok exclusive connection, event when the app is in foreground. and no functions of PushClientManagerDelegate is being called for incoming push notifications. this issue cause the app to have no control over incoming push notifications.

As a workaround I put this code before registering user to Chabok:

if #available(iOS 10.0, *) {
    let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
    UNUserNotificationCenter.current().requestAuthorization(
        options: authOptions,
        completionHandler: {_, _ in })
} else {
    let settings: UIUserNotificationSettings =
        UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
    UIApplication.shared.registerUserNotificationSettings(settings)
}

UIApplication.shared.registerForRemoteNotifications()

let userId = User.currentUser?.id ?? generateRandomId()
(UIApplication.shared.delegate as? AppDelegate)?.manager?.registerUser(userId)

تفاوت Sandbox و Production

با سلام

هنگامی که برنامه را روی Production قرار می دهیم حتی کاربر هم اضافه نمی شود و باید حتما حساب مربوطه را تهیه کند؟ امکان ارتقا از Sandbox به Production برای کاربر وجود دارد تا اطلاعات Sandbox را هم داشته باشد؟

registerUser method's callback doesn't call

Hi
I want to do something with installation id when user registered in chabokpush. so I put my codes in the registerUser's callback in this way:

guard let manager = PushClientManager.default() else { return }
manager.registerUser(userId) { (_, _, _) in
            print(manager.getInstallationId() ?? "??")
}

but it doesn't work. not even prints ??.

  1. why?
  2. could you describe about 3 arguments (Bool, String?, Error?) that callback gives.
    Thanks

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.