Giter Site home page Giter Site logo

namiml / react-native-nami-sdk Goto Github PK

View Code? Open in Web Editor NEW
13.0 6.0 3.0 29.33 MB

React Native wrapper for Nami SDK. Easy Apple StoreKit & Google Play Billing subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.

Home Page: https://www.nami.ml

License: Other

JavaScript 1.41% Objective-C 10.33% Ruby 0.54% Kotlin 35.29% Java 1.47% Python 5.04% Swift 26.87% TypeScript 19.03%
react-native ios subscriptions paywall in-app-purchase ipados storekit android google-play-billing iap

react-native-nami-sdk's People

Contributors

acantarero avatar amaricleroberts avatar bataevvlad avatar brhelwig avatar burcaw avatar findjigar avatar ivezhnavets avatar kigi avatar makiychukyaroslav avatar momspaghetti42 avatar namidan avatar rishiankush avatar whitestranger7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-nami-sdk's Issues

Encountered NoClassDefFoundError on Android platform

On Android if I run the follow code:
Nami.configure();

app will crash and get an error log:
Error: Exception in HostObject::get(property:RNNamiCampaignManager): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/namiml/campaign/NamiCampaign;

Here is some configuration information of my project:

react-native nami: ^3.1.12
android gradle: 4.2.2
maven { url "https://www.jitpack.io" }
maven { url "https://packages.namiml.com/NamiSDK/Android/"}

I checkd the apk data and ensrure the NamiCampaign class is included.
image

Note that It works find on iOS.

Entitlements results some time are false

checking entitlements in many cases read false if you place the block of code in a componentDidMount or place in a function component. In order to get it to work right you have to place it in a timeout. Some times placing it in a timeout is not aways stable. The only way to use without timeout I have to place the code block in a arrow function that is triggered by button. I was hoping to use it by allowing it to run automatically. Its like the code runs to fast as if we need to get time for the app to access the internet.

NativeModules.NamiEntitlementManagerBridge.isEntitlementActive("premium_access", (active) => {
if (active) {
// react to entitlement being active
console.log(active);
}
});

Result equal false

Emitter does not aways work

Having issues with event Emitters. If you have a device that has never made a purchase and you raise a Paywall. After the user has complete a purchase the paywall will disappear. The issue is that if the user device subscription expire and then they purchase a new subscription the emitters do not work. Its like after the first purchase the emitters are died.

const { NamiEmitter } = NativeModules;
const eventEmitter = new NativeEventEmitter(NamiEmitter);

useEffect(() => {
eventEmitter.addListener('EntitlementsChanged', onEntitlementsChanged);
})

2020-11-24 23:06:16.245 22047-22109/com.elmc I/NamiBridge: In Emitter Initialize()
2020-11-24 23:06:17.392 22047-22109/com.elmc I/NamiBridge: Configure called with appID 6f16d816-401c-401d-b85c-c29b7912c8c0
2020-11-24 23:06:17.393 22047-22109/com.elmc I/NamiBridge: Configure called with context com.facebook.react.bridge.ReactApplicationContext@a5ffcd1
2020-11-24 23:06:17.393 22047-22109/com.elmc I/NamiBridge: Nami Configure called with context.applicationContext com.elmc.MainApplication@deee3e7
2020-11-24 23:06:17.393 22047-22109/com.elmc I/NamiBridge: Configure called with (context as Application) true.
2020-11-24 23:06:17.393 22047-22109/com.elmc I/NamiBridge: End Application check
2020-11-24 23:06:17.393 22047-22109/com.elmc I/NamiBridge: Nami Configuration log level passed in is DEGUG
2020-11-24 23:06:17.393 22047-22109/com.elmc I/NamiBridge: Nami Configuration developmentMode is true
2020-11-24 23:06:17.393 22047-22109/com.elmc I/NamiBridge: Nami Configuration bypassStoreMode is false
2020-11-24 23:06:17.394 22047-22109/com.elmc I/NamiBridge: Nami Configuration object is com.namiml.NamiConfiguration@4ee021a
2020-11-24 23:06:17.611 22047-22109/com.elmc I/NamiBridge: Checking for elmc_pro_access entitlement active, result was false
2020-11-24 23:06:40.461 22047-22109/com.elmc I/NamiBridge: Nami Activity to raise paywall is com.elmc.MainActivity@d11db6
2020-11-24 23:06:40.464 22047-22109/com.elmc D/NamiBridge: About to raise Paywall
2020-11-24 23:06:40.464 22047-22109/com.elmc I/NamiBridge: Raising Paywall:
2020-11-24 23:06:40.539 22047-22109/com.elmc I/NamiBridge: Nami flag for blocking paywall raise is false
2020-11-24 23:07:06.757 22047-22047/com.elmc I/NamiBridge: Processing entitlement into Javascript Map with referenceID elmc_pro_access
2020-11-24 23:07:06.767 22047-22109/com.elmc I/NamiBridge: Checking for elmc_pro_access entitlement active, result was false

AFTER PURCHASE WAS SUCCESSFUL

2020-11-24 23:07:06.768 22047-22109/com.elmc I/NamiBridge: Checking for elmc_pro_access entitlement active, result was false
2020-11-24 23:07:07.675 22047-22047/com.elmc I/NamiBridge: Emitting purchase with state PURCHASED
2020-11-24 23:07:07.692 22047-22047/com.elmc D/NamiBridge: Nami Activity result listener activated, code is 6264

Android app crashes

On Android if I run the follow code the app crashes:

NativeModules.NamiBridge.configure(configDict);

If I remove this code the app will run. I have setup everything as what is in the setup documations. It works find on iOS but crashes on Android.

"react": "17.0.1",
"react-native": "0.64.2",
"react-native-nami-sdk": "^1.2.0",

buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
ndkVersion = "20.1.5948944"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:4.2.1')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}

    google()
    jcenter()
    maven { url 'https://www.jitpack.io' }
    maven { url("https://nami-android.s3.amazonaws.com/") }
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.