1.0.5 • Published 6 years ago

cordova-plugin-cbienkit v1.0.5

Weekly downloads
2
License
MIT License
Repository
github
Last release
6 years ago

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 xcode

To install the plugin in your Cordova app, run the following:

cordova plugin add https://github.com/CBien/cbien-cordova.git

Configuring

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

  1. 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"
});
  1. 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,
});
  1. Check if new refresh token needed and set a new one (Optional)
CBKit.refreshTokenNeeded( function(needed) { 
  if (needed) {
    CBKit.setRefreshToken({refreshToken: "refresh_token"}); 
  } 
});
  1. Finally, display CBien screens.
CBKit.show();

CBKit.Font : enum

Kind: static enum property of CBKit Properties

NameTypeDefaultDescription
DEFAULTnumber0Return default font
HELVETICAnumber1Return Helvetica font
LATOnumber2Return Lato font
ROBOTOnumber3Return Roboto font

CBKit.ButtonType : enum

Kind: static enum property of CBKit Properties

NameTypeDefaultDescription
IMAGEnumber0Return image
ICONnumber1Return icon

License

cbien-cordova is released under the MIT License.

Copyright

Copyright (c) 2017, Inc. All rights reserved.

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.0

8 years ago

0.0.12

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago