Skip to content

Commit

Permalink
fix: add missing build configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Dec 8, 2023
1 parent d663ebf commit 65e97fa
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-example-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
with:
working-directory: IapExample
bundler-cache: true
ruby-version: '2.7'

- name: SwiftLint
run: swiftlint lint --fix --format --path ios/*.swift --config .swiftlint.yml
Expand Down
34 changes: 33 additions & 1 deletion IapExample/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"

import com.android.build.OutputFile

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
Expand Down Expand Up @@ -36,7 +38,8 @@ react {
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
entryFile = file("../../index.tsx")

//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
Expand Down Expand Up @@ -101,6 +104,35 @@ android {
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}

flavorDimensions "appstore"

productFlavors {
googlePlay {
dimension "appstore"
missingDimensionStrategy "store", "play"
}

amazon {
dimension "appstore"
missingDimensionStrategy "store", "amazon"
}
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
}

dependencies {
Expand Down
7 changes: 6 additions & 1 deletion IapExample/src/utils/platform.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
import {isAmazon, isAndroid, isIos, isPlay} from '../../../src/internal';
import {
isAmazon,
isAndroid,
isIos,
isPlay,
} from 'react-native-iap/src/internal';
export {isAmazon, isIos, isAndroid, isPlay};
4 changes: 0 additions & 4 deletions ios/RNIapIosSk2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,6 @@ class RNIapIosSk2: RCTEventEmitter, Sk2Delegate {
delegate.stopObserving()
}

override func addListener(_ eventName: String?) {
super.addListener(eventName)
}

/**
"iap-transaction-updated" is unique to Sk2.
"iap-promoted-product" is only avaiable on Sk1
Expand Down

0 comments on commit 65e97fa

Please sign in to comment.