GithubHelp home page GithubHelp logo

ios-sdk's Introduction

Doorbell iOS SDK

The Doorbell iOS SDK.

Full documentation

You can view the full documentation here: https://doorbell.io/docs/ios

Installation

Include Doorbell via CocoaPods: https://cocoapods.org/pods/Doorbell, or via Swift Package Manager

Usage

In the ViewController where you want to use Doorbell, you'll need to import the library using:

#import "Doorbell/Doorbell.h"

Then when you want to show the dialog:

NSString *appId = @"123";
NSString *appKey = @"xxxxxxxxxxxxxxxxxx";

Doorbell *feedback = [Doorbell doorbellWithApiKey:appKey appId:appId];
[feedback showFeedbackDialogInViewController:self completion:^(NSError *error, BOOL isCancelled) {
    if (error) {
        NSLog(@"%@", error.localizedDescription);
    }
}];

To pre-populate the email address (if the user is logged in for example):

NSString *appId = @"123";
NSString *appKey = @"xxxxxxxxxxxxxxxxxx";

Doorbell *feedback = [Doorbell doorbellWithApiKey:appKey appId:appId];
feedback.showEmail = NO;
feedback.email = @"[email protected]";
[feedback showFeedbackDialogInViewController:self completion:^(NSError *error, BOOL isCancelled) {
    if (error) {
        NSLog(@"%@", error.localizedDescription);
    }
}];

ios-sdk's People

Contributors

alexiscreuzot avatar cmaster11 avatar jaredsburrows avatar manavo avatar markborazio avatar shritekale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ios-sdk's Issues

Swift support

Any plans or actively working towards a Doorbell SDKin Swift?
Wondering if I should start porting the current ObjC one.

SwiftUI integration

Hi! Is it possible to use it with/integrate it into SwiftUI? If so, could you add an example to the main page?

Thanks in advance :)

How to alert when message has been sent?

Hello! This is such a great feedback library. When i click send button with empty textField then it will alert error which it is message is required. But i want to handle when user clicks on send button with textField is not empty then i want to alert user that message has been sent or something.

How can I archive something like this?

XCode warnings regarding Umbrealla headers

Hi guys!

Still getting 2 warnings for the library:

Umbrella header for module 'Doorbell' does not include header 'DoorbellDialog.h'
Umbrella header for module 'Doorbell' does not include header 'UIWindow+Doorbell.h'

Thanks,
Thomas

App crashes when sending feedback on iOS 12.5.3

I am testing my app on a couple of physical devices, and my older device seems to always crash when I send the feedback.
Here is what I am seeing:

  • iPhone 8, iOS 14.1 - Never crashes
  • iPhone 6, iOS 12.5.3 - Always crashes

The pod spec does specify an iOS version of 13, but I am not sure if that has anything to do with it.

I am using version 0.3.0 of the sdk.

Details

The app crashes with a signal SIGABRT in Doorbell.m at line 466:

if ([response isKindOfClass:[NSHTTPURLResponse class]]) {

I checked the response object, and got this:

<NSHTTPURLResponse: 0x28008eac0> { URL: https://doorbell.io/api/applications/<REDACTED APP ID>/submit?sdk=ios&version=0.3.0&key=<REDACTED APP KEY> } { Status Code: 201, Headers {
    "Access-Control-Allow-Origin" =     (
        "*"
    );
    "Cache-Control" =     (
        "no-cache, private"
    );
    "Content-Length" =     (
        14
    );
    "Content-Type" =     (
        "text/plain; charset=UTF-8"
    );
    Date =     (
        "Sat, 24 Jul 2021 12:03:02 GMT"
    );
    Server =     (
        Caddy
    );
    Status =     (
        "201 Created"
    );
    "access-control-allow-headers" =     (
        "*"
    );
    "access-control-allow-methods" =     (
        "OPTIONS, GET, POST"
    );
    "access-control-request-method" =     (
        "*"
    );
} }

Visiting the URL in a browser gave me this message:

"Invalid invocation, missing JSONP callback"

Lastly, and maybe I am wrong about this, but the response shouldn't have the app key in it, right?

Sending tags from sdk

Is it possible to send tags? On Android there is doorbellDialog.setTags(new ArrayList<String>(Arrays.asList("tag1", "tag2")));

Deprecated API

Hi! Just to let you know:

[[UIApplication sharedApplication] openURL:doorbellURL];

XCode complains, at the line above:

'openURL:' is deprecated: first deprecated in iOS 10.0

Crash if completion block is nil

If I present the feedback dialog with a nil completion block, the sdk will crash in the [Doorbell finish] method when calling self.block(nil, NO).

Please note that I am using the sdk in a Swift project.

Custom form email validation doesn't return an error

Issue description

A customs form will not error if email validation fails.

Steps to reproduce the issue

For reproduce best to use an email with .xz ending.

    feedback!.submitFeedback("Your message", email: "[email protected]", completion: { (error, _unused) -> Void in
        if (error?.localizedDescription != nil) {
            print(error!.localizedDescription);
        }
    })

What's the expected result?

A. Message successfully send because I allow optional email
B. I get an error in the closure

What's the actual result?

My message was not delivered and closure is not called.
In log console I get only this message:
Response data: Invalid email address

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.