Skip to content

Commit

Permalink
Merge pull request #17 from uerceg/v117
Browse files Browse the repository at this point in the history
Version 1.1.7
  • Loading branch information
uerceg authored Oct 19, 2021
2 parents 5fd6b9c + 71e680a commit e787ef1
Show file tree
Hide file tree
Showing 56 changed files with 4,225 additions and 4,896 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### Version 1.1.7 [20th October 2021]
#### Changed
- Updated native Play Install Referrer library to **v2.2**.

#### Fixed
- Fixed `addListener` and `removeListeners` warnings ([same issue](https://github.com/react-native-netinfo/react-native-netinfo/issues/486) with [suggested fix](https://github.com/software-mansion/react-native-reanimated/pull/2316/files) which got copy pasted in this plugin as well). Thanks to @mikehardy.

---

### Version 1.1.6 [29th December 2020]
#### Added
- Added **Example app** chapter to README.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 uerceg
Copyright (c) 2021 uerceg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</tr>
<tr>
<td align="left">Current version:</td>
<td align="left"><a href=../../releases/tag/v1.1.6><b>1.1.6</b></a></td>
<td align="left"><a href=../../releases/tag/v1.1.7><b>1.1.7</b></a></td>
</tr>
<tr>
<td align="left">Troubles?</td>
Expand All @@ -19,7 +19,7 @@

More information about Play Install Referrer API can be found in [official Google documentation](https://developer.android.com/google/play/installreferrer/igetinstallreferrerservice).

Version of native Play Install Referrer Library which is being used inside of latest **react-native-play-install-referrer** plugin version is [2.1](https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer/2.1).
Version of native Play Install Referrer Library which is being used inside of latest **react-native-play-install-referrer** plugin version is [2.2](https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer/2.2).

## Add plugin to your app

Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Latest version of this plugin will always be the only currently supported one. I

| Version | Supported |
| ------- | ------------------ |
| 1.1.6 | :white_check_mark: |
| 1.1.7 | :white_check_mark: |
| 1.1.6 | :x: |
| 1.1.5 | :x: |
| 1.1.4 | :x: |
| 1.1.3 | :x: |
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# List of things to be done in the repository

- [ ] Switch to usage of Install Referrer API via AIDL.
- [ ] Update Install Referrer Library to version 2.2.
- [x] Update Install Referrer Library to version 2.2.
- [x] Move plugin content to root of the repository to avoid having duplicated README file.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.6
1.1.7
13 changes: 6 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ apply plugin: 'com.android.library'

def _ext = rootProject.ext

def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 29
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : "29.0.0"
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 31
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 29
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 31

android {
compileSdkVersion _compileSdkVersion
buildToolsVersion _buildToolsVersion

defaultConfig {
minSdkVersion _minSdkVersion
targetSdkVersion _targetSdkVersion
versionCode 2
versionName "1.1.0"
versionCode 3
versionName "1.1.7"
}

buildTypes {
release {
minifyEnabled false
Expand All @@ -27,5 +26,5 @@ android {

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.android.installreferrer:installreferrer:2.1'
implementation 'com.android.installreferrer:installreferrer:2.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// play-install-referrer-react-native
//
// Created by Uglješa Erceg (@uerceg) on 24th April 2020.
// Copyright (c) 2020 uerceg. All rights reserved.
// Copyright (c) 2021 uerceg. All rights reserved.
//

package com.uerceg.play_install_referrer;
Expand Down Expand Up @@ -135,4 +135,16 @@ private void sendEvent(ReactContext reactContext, String eventName, @Nullable Wr
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit(eventName, params);
}

@ReactMethod
public void addListener(String eventName) {
// trying to fix following warning:
// WARN `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
}

@ReactMethod
public void removeListeners(Integer count) {
// trying to fix following warning:
// WARN `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// play-install-referrer-react-native
//
// Created by Uglješa Erceg (@uerceg) on 25th April 2020.
// Copyright (c) 2020 uerceg. All rights reserved.
// Copyright (c) 2021 uerceg. All rights reserved.
//

package com.uerceg.play_install_referrer;
Expand Down
3 changes: 3 additions & 0 deletions app/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Windows files
[*.bat]
end_of_line = crlf
17 changes: 4 additions & 13 deletions app/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

Expand All @@ -27,8 +23,9 @@ node_modules/react-native/flow/
[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
exact_by_default=true

format.bracket_spacing=false

module.file_ext=.js
module.file_ext=.json
Expand All @@ -44,10 +41,6 @@ suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -56,10 +49,8 @@ untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
Expand All @@ -71,4 +62,4 @@ untyped-import
untyped-type-import

[version]
^0.113.0
^0.158.0
4 changes: 3 additions & 1 deletion app/.gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.pbxproj -text
# Windows files should use crlf line endings
# https://help.github.com/articles/dealing-with-line-endings/
*.bat text eol=crlf
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ build/
.gradle
local.properties
*.iml
*.hprof

# node.js
#
Expand Down
1 change: 1 addition & 0 deletions app/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
};
4 changes: 2 additions & 2 deletions app/android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.uerceg.example",
package = "com.app",
)

android_resource(
name = "res",
package = "com.uerceg.example",
package = "com.app",
res = "src/main/res",
)

Expand Down
41 changes: 20 additions & 21 deletions app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.android.build.OutputFile
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
Expand Down Expand Up @@ -120,23 +120,22 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false);

/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")

android {
compileSdkVersion rootProject.ext.compileSdkVersion
ndkVersion rootProject.ext.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
applicationId "com.uerceg.example"
applicationId "com.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"

// https://stackoverflow.com/questions/61479338/android-studio-react-native-build-fails
multiDexEnabled true
}
splits {
abi {
Expand All @@ -157,33 +156,32 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}

packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
pickFirst "lib/x86/libc++_shared.so"
pickFirst "lib/x86_64/libc++_shared.so"
}

// 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 =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}

}
Expand All @@ -198,11 +196,12 @@ dependencies {
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
exclude group:'com.facebook.fbjni'
}

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
Expand All @@ -221,7 +220,7 @@ dependencies {
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
from configurations.implementation
into 'libs'
}

Expand Down
7 changes: 6 additions & 1 deletion app/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.example;
package com.app;

import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
Expand Down
4 changes: 1 addition & 3 deletions app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.uerceg.example">
package="com.app">

<uses-permission android:name="android.permission.INTERNET" />

Expand All @@ -21,7 +21,5 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uerceg.example;
package com.app;

import com.facebook.react.ReactActivity;

Expand All @@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "Example";
return "app";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uerceg.example;
package com.app;

import android.app.Application;
import android.content.Context;
Expand Down Expand Up @@ -62,7 +62,7 @@ private static void initializeFlipper(
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.uerceg.example.ReactNativeFlipper");
Class<?> aClass = Class.forName("com.app.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
Expand Down
2 changes: 1 addition & 1 deletion app/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Example</string>
<string name="app_name">app</string>
</resources>
Loading

0 comments on commit e787ef1

Please sign in to comment.