项目作者: hypery2k

项目描述 :
Handling App URLs in nativescript apps
高级语言: JavaScript
项目地址: git://github.com/hypery2k/nativescript-fabric.git
创建时间: 2016-11-28T07:11:25Z
项目社区:https://github.com/hypery2k/nativescript-fabric

开源协议:MIT License

下载


android" class="reference-link">NativeScript Fabric Plugin apple android

Greenkeeper badge
Build Status
Donate with Bitcoin

npm version
Maintainability

NPM

Feel free to donate




Or donate Bitcoins: bitcoin:3NKtxw1SRYgess5ev4Ri54GekoAgkR213D

Bitcoin

Also via greenaddress

Usage

Installation

Go to Crashlytics and pick of the needed API-Key and API-Secret:

Create a file fabric.json in the project root folder and add the API-Key and API-Secret:

  1. {
  2. "using_ios": true,
  3. "using_android": true,
  4. "api_key": "...",
  5. "api_secret": "..."
  6. }
  1. $ tns plugin add nativescript-fabric

Or if you want to use the development version (nightly build), which maybe not stable!:

  1. $ tns plugin add nativescript-fabric@next

Android

Add the API-Key to your AndroidManifest.xml:

  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="__PACKAGE__" android:versionCode="385" android:versionName="1.0.14">
  3. ....
  4. <application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
  5. ...
  6. <meta-data android:name="io.fabric.ApiKey" android:value="**<API-KEY>**"/>
  7. </application>
  8. </manifest>

iOS

No further confiugration needed

Additional information

Android

For more details see fabric.io/kits/android/crashlytics.

iOS

For more details see fabric.io/kits/ios/crashlytics.

API

Init the plugin in your app (for angular apps use main.ts):

  1. import { Fabric } from 'nativescript-fabric';
  2. Fabric.init();

Afterwards you can use the instance methods for logging (general error logging is already added):

  • Fabric.logSignUp(method: string, success: boolean);
  • Fabric.logLogin(method: string, success: boolean);
  • Fabric.logContentView(id: string, name: string, type: string)
  • Fabric.logCustomEvent(withName: string, customAttributes: Map<String, String>)
  • Fabric.logError(error: any, msg?: string)

Angular

  1. import { FabricModule } from 'nativescript-fabric/angular';
  2. NgModule({
  3. ...
  4. imports: [
  5. FabricModule.forRoot()
  6. ],

Known Issues

com.android.ide.common.process.ProcessException

  1. FAILURE: Build failed with an exception.
  2. * What went wrong:
  3. Execution failed for task ':app:transformClassesWithDexForF0F1F2F3F4F5Debug'.
  4. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: Cannot merge new index 69013 into a non-jumbo instruction!nto a non-jumbo instruction!

set the following in your app.gradle:

  1. android {
  2. ...
  3. dexOptions {
  4. jumboMode true
  5. }
  6. }

XML Parsing error

  1. Error:/app/build/intermediates/res/merged/debug/values/com_crashlytics_build_id.xml uncompiled XML file passed as argument. Must be compiled first into .flat file.

Try adding:

  1. android.enableAapt2 = false

to your gradle.properties file.