Skip to content

Dev -> Master #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
43 changes: 19 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
name: '🚀 release'
on:
push:
branches: [ master ]
release:
types: [published]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
release:
name: 🚀 release
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 14.17.6
- name: Install Dependencies
run: npm install
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: 📚 checkout
uses: actions/checkout@v3
- name: 🟢 node
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: 🚀 publish
uses: JS-DevTools/npm-publish@v2
with:
access: public
token: ${{secrets.NPM_TOKEN}}
68 changes: 45 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
Expand All @@ -21,44 +28,59 @@ DerivedData
*.ipa
*.xcuserstate
project.xcworkspace
package-lock.json
**/.xcode.env.local

# Android/IntelliJ
# Android/IJ
#
build/
.idea
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
*.iml
android.iml

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
yarn.lock

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore
android/app/libs
android/keystores/debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo/

# Turborepo
.turbo/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
# generated by bob
lib/

# Bundle artifact
*.jsbundle
# React Native Codegen
ios/generated
android/generated

# CocoaPods
/ios/Pods/
android/barnabas.jks
android/app/release/
# React Native Nitro Modules
nitrogen/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
nodeLinker: node-modules
nmHoistingLimits: workspaces

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## 1.1.0

**Breaking Changes:**
- Added support for new architecture
- Removed steps for native setup
- Added method for Javascript/Typescript with update type (immediate, flexible)

## 1.0.3

- Added support for Android target SDK 34

## 1.0.2-beta

- Added support for Android 12 and above (Verified)

## 1.0.2-beta

- Added support for Android 12 and above

## 1.0.0

- Initial release
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MIT License

Copyright (c) 2020 Logicwind

Copyright (c) 2025 Logicwind
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
117 changes: 69 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,97 @@
# react-native-rn-in-app-update

Google in-app updates support for react-native. Specially created for android only. After installing plugin user will get android app update popup if there is any update available on play store.
A minimal React Native module that displays the native Android in-app update popup using the Play Core library. Supports both immediate and flexible update types.

## Installation

`$ npm install react-native-rn-in-app-update --save`
Using npm:

## Linking (RN < 0.60)
```sh md title="Terminal"
npm install react-native-rn-in-app-update
```

or using yarn:

```sh md title="Terminal"
yarn add react-native-rn-in-app-update
```

## Usage

`$ react-native link react-native-rn-in-app-update`
Import and use the `showUpdatePopup` function. it supports 2 update type **immediate** and **flexible**

### Android
only react-native link require
```tsx md title="App.tsx"
import { showUpdatePopup } from 'react-native-rn-in-app-update';

<Button title="Get Update" onPress={() => showUpdatePopup('immediate')} />;
```

## Linking (RN >= 0.60)
## How to Test In-App Updates on Android

### Android
It will auto linked after installing package
To test this package correctly, you must publish your app to the Play Store (even if only in **Internal Testing**) — the in-app update API only works when your app is installed via **Google Play**.

### Step 1: Upload a lower-version build (v1)

### IOS
No native implementation for ios. If project show missing pod error then perform following step:
Create a signed APK/AAB with version:

```sh
versionCode 100
versionName "1.0.0"
```
cd ios && pod install

Upload this build to the Play Console → Internal Testing track.

Publish it and wait until it’s available for testers (usually within 15–30 minutes).

Install the app from the Play Store using a tester account.

### Step 2: Prepare a higher-version build (v2)

Increment version:

```sh
versionCode 101
versionName "1.1.0"
```

## Additional configuration in android (Required)
DO NOT UPLOAD IT YET.

This is your update version, which the Play Store will later offer as an available update.

### Add Below Lines in MainActivity.java
### Step 3: Open the app (v1) with your test logic

Ensure your app runs this on launch or on button click:

```tsx
showUpdatePopup('immediate');
```
...
...
import com.logicwind.inappupdate.InAppUpdateUtils; // add this

// Create object :
private InAppUpdateUtils appUpdateUtils;


@Override
protected void onCreate(Bundle savedInstanceState) {
...
...
appUpdateUtils = new InAppUpdateUtils(this); // add this
appUpdateUtils.initAppUpdaterAndCheckForUpdate(); // add this
appUpdateUtils.registerListener(); // add this
}

// Add below method also
@Override
protected void onResume() {
super.onResume();
appUpdateUtils.ifUpdateDownloadedThenInstall();
}

// Add below method also
@Override
protected void onDestroy() {
super.onDestroy();
appUpdateUtils.unregisterListener();
}

At this point, no popup will appear, because there's no newer version yet.

### Step 4: Upload the higher version (v2)

Now upload the v2 build (with versionCode = 101) to Internal Testing.

Publish and wait until it’s live for testers (can take up to 30–60 minutes).

### Step 5: Reopen the app

Reopen the installed v1 app on your test device (it’s still running versionCode = 100).

You should now see the in-app update popup, triggered by:

```tsx
showUpdatePopup('immediate');
```

### That's it. Configuration done. No need to add anything in your application js file.
**Find more details for testing [here](https://developer.android.com/guide/playcore/in-app-updates/test)**

## react-native-rn-in-app-update is crafted mindfully at [Logicwind](https://www.logicwind.com?utm_source=github&utm_medium=github.com-logicwind&utm_campaign=react-native-rn-in-app-update)

We are a 130+ people company developing and designing multiplatform applications using the Lean & Agile methodology. To get more information on the solutions that would suit your needs, feel free to get in touch by [email](mailto:sales@logicwind.com) or through or [contact form](https://www.logicwind.com/contact-us?utm_source=github&utm_medium=github.com-logicwind&utm_campaign=react-native-rn-in-app-update)!

## How to test in-app-update?
Please find testing instruction [here](https://developer.android.com/guide/playcore/in-app-updates/test#:~:text=Use%20internal%20app%20sharing%20to,to%20share%20your%20app%20internally)
We will always answer you with pleasure 😁

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
35 changes: 0 additions & 35 deletions android/README.md

This file was deleted.

Loading