Skip to content

Commit

Permalink
Merge pull request #76 from getbouncer/api_key_for_readme
Browse files Browse the repository at this point in the history
Api key for readme
  • Loading branch information
kingst authored Sep 17, 2019
2 parents 3a66ec4 + 80c5050 commit dbfd4f9
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ file:

## Configure CardScan (Swift)

Configure the library when your application launches:
Make sure that you get an [API
key](https://api.getbouncer.com/console) and configure the library
when your application launches:

```swift
import UIKit
Expand All @@ -95,13 +97,20 @@ import CardScan
class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
ScanViewController.configure()
// if you need to get an API key you can get one from here:
// https://api.getbouncer.com/console
ScanViewController.configure(apiKey: "YOUR_API_KEY_HERE")
// do any other necessary launch configuration
return true
}
}
```

By setting the API key the SDK will send anonymous stats to Bouncer's
servers. [This code
snippet](https://github.com/getbouncer/cardscan-ios/blob/da77e36c49f1de4b678e7ecaab56cc1466602716/CardScan/Classes/ScanStats.swift#L50)
shows what we send.

## Using CardScan (Swift)

To use CardScan, you create a `ScanViewController`, display it, and
Expand Down Expand Up @@ -177,7 +186,9 @@ if !ScanViewController.isCompatible() {

## Configure CardScan (Objective C)

Configure the library when your application launches:
Make sure that you get an [API
key](https://api.getbouncer.com/console) and configure the library
when your application launches:

```objective-c
#import "AppDelegate.h"
Expand All @@ -186,13 +197,20 @@ Configure the library when your application launches:
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[ScanViewController configure];
// if you need to get an API key you can get one from here:
// https://api.getbouncer.com/console
[ScanViewController configureWithApiKey:@"YOUR_API_KEY_HERE"];
return YES;
}

@end
```
By setting the API key the SDK will send anonymous stats to Bouncer's
servers. [This code
snippet](https://github.com/getbouncer/cardscan-ios/blob/da77e36c49f1de4b678e7ecaab56cc1466602716/CardScan/Classes/ScanStats.swift#L50)
shows what we send.
## Using CardScan (Objective C)
To use CardScan, you create a `ScanViewController`, display it, and
Expand Down

0 comments on commit dbfd4f9

Please sign in to comment.