npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-as-attribution-sdk-bridge

v1.0.15

Published

AS Attribution SDK Bridge

Downloads

36

Readme

React Native Bridge For AppSamurai Attribution SDK

React Native Bridge For AppSamurai Attribution SDK is a project for React Native applications to use AppSamurai Attribution SDK.

alt text

Getting Started

Add react-native-as-attribution-sdk-bridge to your dependencies with one of the options below(yarn or npm);

yarn add react-native-as-attribution-sdk-bridge
npm install --save react-native-as-attribution-sdk-bridge

Linking library react-native 0.60+ handles autolinking as it mentioned in autolinking in react-native. For react-native 0.60- version auto linking needs to be done to use libraries with native dependencies correctly. Please refer detailed explanation from Linking Libraries in iOS

react-native link react-native-as-attribution-sdk-bridge

iOS Platform Notes

AppSamurai Attribution SDK targets iOS 10 or higher. Projects those use CocoaPods do not forget to run pod install. You need to initialize ASAttributionSDK to use AppSamurai Attribution SDK. First, you need to import ASAttributionSDK module in your AppDelegate file;

@import ASAttributionSDK;

Then you need to add the following initialization line to your application’s didFinishLaunchingWithOptions method in AppDelegate:

[ASAttribution initialize:@"your-user-id"];

"your-user-id" parameter should be your user id retrieved from AppSamurai User Dashboard, you can use your user id for integration purposes.

Android Platform Notes

Minimum supported SDK version is 14. Please make sure that you are using the latest version of gradle and gradle android plugin. You need to add multidex support to Android project. You can do this by adding the following line to app’s gradle.

defaultConfig {
    ....
    multiDexEnabled true
    ...
}

Add the following dependency to the dependencies block in app/build.gradle. Be sure to add the latest release for attribution sdk which is: Download

implementation 'com.ppsmr.attribution.attributionsdk:attribution:<latest-version>'

You need to initialize ASAttributionSDK to use AppSamurai Attribution SDK. First, you need to import AttributionSDK module in your MainApplication file;

import com.ppsmr.attribution.attributionsdk.AttributionSDK;

Then you need to add the following initialization line to your application’s onCreate method in MainApplication file:

@Override
public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
    AttributionSDK.Instance.initialize("your-user-id");
}

"your-user-id" parameter should be your user id retrieved from AppSamurai User Dashboard, you can use your user id for integration purposes.

For Publishers Supporting Android API Level < 21

If your minSdkVersion is set to 20 or lower and when multidex is enabled you need to do additional changes. Please import MultiDexApplication package instead of Application package in your MainApplication file.

import androidx.multidex.MultiDexApplication;

Then extend your MainApplication class with MultiDexApplication instead of Application class:

public class MainApplication extends MultiDexApplication implements ReactApplication {
    ...
}

If the previous solution does not fit for you, you can apply another solution from https://developer.android.com/studio/build/multidex.html#mdex-gradle.

Add the following multidex dependency to the dependencies block in app/build.gradle. Be sure to add the latest release for multidex library. If you are not using AndroidX, please use the following dependency:

implementation 'com.android.support:multidex:1.0.3'

If you are using AndroidX, use the following dependency instead of the previous one:

implementation 'androidx.multidex:multidex:2.0.1'

Usage in React-Native

Import the module

import AsAttributionSdkBridge from 'react-native-as-attribution-sdk-bridge';

Custom Event Tracking

Using AppSamurai Attribution SDK, you are able to track the frequency of custom events by placing the following code piece into your own application code. You can also attach data to your events. If you are planning to attach data to your event, make sure your map is JSON serializable.

AsAttributionSdkBridge.track("string-event-name")
AsAttributionSdkBridge.trackWithData("string-event-name", map<String:"<JSON Serializable Object>">)

Examples:

// Track event with no event data
AsAttributionSdkBridge.track("user-login")

// Track event with data
var dataMap = {
    "type": "water-bottle",
    "amount": 40.0,
    "currency": "dollar",
    "properties": {
        "color": "blue",
        "size": "L"
    },
    "last-product-views": ["Bags", "Shorts", "Bottles"]
}
AsAttributionSdkBridge.trackWithData("purchase", dataMap)

Log Level

AppSamurai SDK logging level can be changed with setLogLevel after SDK initialization. Available log levels are "OFF", "DEBUG", "WARNING" and "ERROR". Default log level is "DEBUG".

AsAttributionSdkBridge.setLogLevel("string-log-level")

Author

App Samurai Mobile Team, [email protected]

License

Copyright 2018 App Samurai Inc. alt text