1.0.5 • Published 8 years ago
cordova-plugin-cbienkit v1.0.5
CBKit for Cordova
This is a plugin that allows your Cordova app to use CBKit for iOS and Android.
Supported Platforms
- Android 4.0.3+ (API15)
- iOS 8.0+
Installation
Add xcode package (iOS only) :
npm install xcodeTo install the plugin in your Cordova app, run the following:
cordova plugin add https://github.com/CBien/cbien-cordova.gitConfiguring
To configure CBKit, you must add domains names and your app's keys to your config.xml:
<access origin="http://*.cbien.com"></access>
<access origin="http://cbien-partner.herokuapp.com"></access>
<access origin="http://*.amazonaws.com"></access>
<access origin="http://*.newrelic.com"></access>
<access origin="http://*.nr-data.net"></access>
<access origin="http://*.googleapis.com"></access>
<preference name="cbien-ios-clientid" value="your_client_id_for_ios"/>
<preference name="cbien-ios-clientsecret" value="your_client_secret_for_ios"/>
<preference name="cbien-ios-inproduction" value="true_or_false"/>
<preference name="cbien-android-clientid" value="your_client_id_for_android"/>
<preference name="cbien-android-clientsecret" value="your_client_secret_for_android"/>
<preference name="cbien-android-inproduction" value="true_or_false"/>Use
- Firstly, on successful completion of login (or wherever you check your user's authenticated state when your app starts up) you will need to initialize with user's identifier.
CBKit.initialize({
uniqueIdentifier: "unique_identifier"
});- Also, you can customize colors (all parameters are optional)
CBKit.configure({
primaryColor : "#004B9B",
colorOnPrimaryColor : "#FFFFFF", // iOS only
secondaryColor : "#FDC600",
colorOnSecondaryColor : "#FFFFFF", // iOS only
stuffColor : "#41F4C4",
vehicleColor : "#636C8C",
domainColor : "#D39ACC",
headerBackgroundColor : "#FF3730",
headerTextIconColor : "#684514",
headerIndicatorColor : "#E4FF6D",
buttonType : CBKit.ButtonType.ICON,
font : CBKit.Font.ROBOTO,
});- Check if new refresh token needed and set a new one (Optional)
CBKit.refreshTokenNeeded( function(needed) {
if (needed) {
CBKit.setRefreshToken({refreshToken: "refresh_token"});
}
});- Finally, display CBien screens.
CBKit.show();CBKit.Font : enum
Kind: static enum property of CBKit
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| DEFAULT | number | 0 | Return default font |
| HELVETICA | number | 1 | Return Helvetica font |
| LATO | number | 2 | Return Lato font |
| ROBOTO | number | 3 | Return Roboto font |
CBKit.ButtonType : enum
Kind: static enum property of CBKit
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| IMAGE | number | 0 | Return image |
| ICON | number | 1 | Return icon |
License
cbien-cordova is released under the MIT License.
Copyright
Copyright (c) 2017, Inc. All rights reserved.
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago
0.1.7
9 years ago
0.1.6
9 years ago
0.1.3
9 years ago
0.1.2
9 years ago
0.1.0
9 years ago
0.0.12
10 years ago
0.0.10
10 years ago
0.0.9
10 years ago
0.0.8
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago