-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test file for the type definitions
- Loading branch information
Justin Unterreiner
committed
Feb 18, 2016
1 parent
8ba69fa
commit e52a92f
Showing
3 changed files
with
107 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,21 +40,21 @@ Below are a few examples; see the API documentation for a complete list. | |
## Simulate a native crash | ||
|
||
```javascript | ||
window.fabric.crashlytics.addLog("about to send a crash for testing!"); | ||
window.fabric.crashlytics.sendCrash(); | ||
window.fabric.Crashlytics.addLog("about to send a crash for testing!"); | ||
window.fabric.Crashlytics.sendCrash(); | ||
``` | ||
|
||
## Set information for crash reports | ||
```javascript | ||
window.fabric.crashlytics.setUserIdentifier("123"); | ||
window.fabric.crashlytics.setUserName("Some Guy"); | ||
window.fabric.crashlytics.setUserEmail("[email protected]"); | ||
window.fabric.crashlytics.setStringValueForKey("bar", "foo"); | ||
window.fabric.Crashlytics.setUserIdentifier("123"); | ||
window.fabric.Crashlytics.setUserName("Some Guy"); | ||
window.fabric.Crashlytics.setUserEmail("[email protected]"); | ||
window.fabric.Crashlytics.setStringValueForKey("bar", "foo"); | ||
``` | ||
|
||
## Send a Sign Up event | ||
```javascript | ||
window.fabric.answers.sendSignUp("Facebook", true); | ||
window.fabric.Answers.sendSignUp("Facebook", true); | ||
``` | ||
|
||
## Send a Sign Up event (with custom attributes) | ||
|
@@ -64,12 +64,12 @@ var attributes = { | |
bar: true, | ||
}; | ||
|
||
window.fabric.answers.sendSignUp("Facebook", true, attributes); | ||
window.fabric.Answers.sendSignUp("Facebook", true, attributes); | ||
``` | ||
|
||
## Send a Add To Cart event | ||
```javascript | ||
window.fabric.answers.sendAddToCart(29.95, "USD", "Foo Bar Shirt", "apparel", "123"); | ||
window.fabric.Answers.sendAddToCart(29.95, "USD", "Foo Bar Shirt", "apparel", "123"); | ||
``` | ||
|
||
# Notes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/// <reference path="cordova-fabric-plugin.d.ts" /> | ||
|
||
var fabricApi: FabricPlugin.FabricPluginStatic = fabric; | ||
var answersApi: FabricPlugin.Answers = fabric.Answers; | ||
var crashlyticsApi: FabricPlugin.Crashlytics = fabric.Crashlytics; | ||
|
||
fabric.Crashlytics.addLog("Message"); | ||
|
||
fabric.Crashlytics.sendCrash(); | ||
|
||
fabric.Crashlytics.sendNonFatalCrash("Error"); | ||
|
||
fabric.Crashlytics.setUserIdentifier("123"); | ||
|
||
fabric.Crashlytics.setUserName("bob"); | ||
|
||
fabric.Crashlytics.setUserEmail("[email protected]"); | ||
|
||
fabric.Crashlytics.setStringValueForKey("value", "key"); | ||
|
||
fabric.Crashlytics.setIntValueForKey(1, "key"); | ||
|
||
fabric.Crashlytics.setBoolValueForKey(true, "key"); | ||
|
||
fabric.Crashlytics.setFloatValueForKey(1.1, "key"); | ||
|
||
fabric.Answers.sendPurchase(); | ||
fabric.Answers.sendPurchase(24.95); | ||
fabric.Answers.sendPurchase(24.95, "USD"); | ||
fabric.Answers.sendPurchase(24.95, "USD", true); | ||
fabric.Answers.sendPurchase(24.95, "USD", true, "Foo Bar Shirt"); | ||
fabric.Answers.sendPurchase(24.95, "USD", true, "Foo Bar Shirt", "apparel"); | ||
fabric.Answers.sendPurchase(24.95, "USD", true, "Foo Bar Shirt", "apparel", "123"); | ||
fabric.Answers.sendPurchase(24.95, "USD", true, "Foo Bar Shirt", "apparel", "123", { "key": "value" }); | ||
|
||
fabric.Answers.sendAddToCart(); | ||
fabric.Answers.sendAddToCart(24.95); | ||
fabric.Answers.sendAddToCart(24.95, "USD"); | ||
fabric.Answers.sendAddToCart(24.95, "USD", "Foo Bar Shirt"); | ||
fabric.Answers.sendAddToCart(24.95, "USD", "Foo Bar Shirt", "apparel"); | ||
fabric.Answers.sendAddToCart(24.95, "USD", "Foo Bar Shirt", "apparel", "123"); | ||
fabric.Answers.sendAddToCart(24.95, "USD", "Foo Bar Shirt", "apparel", "123", { "key": "value" }); | ||
|
||
fabric.Answers.sendStartCheckout(); | ||
fabric.Answers.sendStartCheckout(24.95); | ||
fabric.Answers.sendStartCheckout(24.95, "USD", 2); | ||
fabric.Answers.sendStartCheckout(24.95, "USD", 2, { "key": "value" }); | ||
|
||
fabric.Answers.sendSearch("query"); | ||
fabric.Answers.sendSearch("query", { "key": "value" }); | ||
|
||
fabric.Answers.sendShare(); | ||
fabric.Answers.sendShare("Facebook"); | ||
fabric.Answers.sendShare("Facebook", "Foo Bar Shirt"); | ||
fabric.Answers.sendShare("Facebook", "Foo Bar Shirt", "apparel"); | ||
fabric.Answers.sendShare("Facebook", "Foo Bar Shirt", "apparel", "123"); | ||
fabric.Answers.sendShare("Facebook", "Foo Bar Shirt", "apparel", "123", { "key": "value" }); | ||
|
||
fabric.Answers.sendRatedContent(); | ||
fabric.Answers.sendRatedContent(5); | ||
fabric.Answers.sendRatedContent(5, "Foo Bar Shirt"); | ||
fabric.Answers.sendRatedContent(5, "Foo Bar Shirt", "apparel"); | ||
fabric.Answers.sendRatedContent(5, "Foo Bar Shirt", "apparel", "123", { "key": "value" }); | ||
|
||
fabric.Answers.sendSignUp(); | ||
fabric.Answers.sendSignUp("Facebook"); | ||
fabric.Answers.sendSignUp("Facebook", true); | ||
fabric.Answers.sendSignUp("Facebook", true, { "key": "value" }); | ||
|
||
fabric.Answers.sendLogIn(); | ||
fabric.Answers.sendLogIn("Facebook"); | ||
fabric.Answers.sendLogIn("Facebook", true); | ||
fabric.Answers.sendLogIn("Facebook", true, { "key": "value" }); | ||
|
||
fabric.Answers.sendInvite(); | ||
fabric.Answers.sendInvite("Facebook"); | ||
fabric.Answers.sendInvite("Facebook", { "key": "value" }); | ||
|
||
fabric.Answers.sendLevelStart(); | ||
fabric.Answers.sendLevelStart("Chemical Plant Zone - Act 1"); | ||
fabric.Answers.sendLevelStart("Chemical Plant Zone - Act 1", { "key": "value" }); | ||
|
||
fabric.Answers.sendLevelEnd(); | ||
fabric.Answers.sendLevelEnd(""); | ||
fabric.Answers.sendLevelEnd("", 9000); | ||
fabric.Answers.sendLevelEnd("", 9000, true); | ||
fabric.Answers.sendLevelEnd("", 9000, true, { "key": "value" }); | ||
|
||
fabric.Answers.sendContentView("Home"); | ||
fabric.Answers.sendContentView("Home", "Page"); | ||
fabric.Answers.sendContentView("Home", "Page", "123"); | ||
fabric.Answers.sendContentView("Home", "Page", "123", { "key": "value" }); | ||
|
||
fabric.Answers.sendCustomEvent("My Event"); | ||
fabric.Answers.sendCustomEvent("My Event", { "key": "value" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters