Skip to content
Merged
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
20 changes: 13 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a bug report to help us improve
title: ''
labels: bug
assignees: adriangl

---

**Device and SW details (please complete the following information):**
- Device: [e.g. Google Pixel 3]
- OS: [e.g. Android 9]
- Library Version [e.g. 1.0.0]
**Device and SW details**
- Device: [e.g. Google Pixel 3]
- OS: [e.g. Android 9]
- Library Version [e.g. 1.0.0]

**Conditions for the library to work**
- [ ] I have set the package name of the app to **exactly** the one I'd like to test in-app updates with.
- [ ] I have signed the app with the same key that I used to sign the app I want to test in-app updates with.
- [ ] I've ensured that any of my Google accounts in my test device has access to said app in Google Play Store.
- [ ] The Google Play Store displays updates for the app I want to use to test in-app updates with.

**Summary and background of the bug**
A clear and concise description of what the bug is.

**Steps to reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
2. Click on '...'
3. Scroll down to '...'
4. See error

Also attach notes or stack traces if applicable.
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ captures/
.idea/dictionaries
.idea/libraries
.idea/caches
.idea/codeStyles
.idea/modules.xml
.idea/misc.xml
.idea/jarRepositories.xml
.idea/vcs.xml

# Keystore files
*.jks
Expand All @@ -57,4 +57,7 @@ google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
freeline_project_description.json

# App configuration properties
app_config.properties
134 changes: 134 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

119 changes: 95 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,127 @@

This utility library aims to help Android developers to use the [Google Play In-App Updates API](https://developer.android.com/guide/app-bundle/in-app-updates) in an easy way.

**It's highly encouraged that you first read the [Google Play In-App Updates API](https://developer.android.com/guide/app-bundle/in-app-updates) documentation before using this library in order to understand the core concepts of the library.**
> It's highly encouraged that you first read the [Google Play In-App Updates API](https://developer.android.com/guide/app-bundle/in-app-updates) documentation before using this library in order to understand the core concepts of the library.

## Setting Up
In your main `build.gradle`, add [jitpack.io](https://jitpack.io/) repository in the `allprojects` block:

<details open><summary>Groovy</summary>

## Installation
Add the following dependencies to your main `build.gradle`:
```groovy
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
```
</details>

Add the following dependencies to your app's `build.gradle`:
<details><summary>Kotlin</summary>

* For Gradle < 4.0
```groovy
dependencies {
compile "com.github.bq:android-app-updates-helper:1.0.2"
```kotlin
allprojects {
repositories {
maven(url = "https://jitpack.io")
}
```
}
```
</details>


Add the following dependencies to your app or library's `build.gradle`:

<details open><summary>Groovy</summary>

```groovy
dependencies {
implementation "com.github.bq:android-app-updates-helper:1.0.2"
}
```
</details>


<details><summary>Kotlin</summary>

```kotlin
dependencies {
implementation("com.github.bq:android-app-updates-helper:1.0.2")
}
```
</details>

* For Gradle 4.0+
```groovy
dependencies {
implementation "com.github.bq:android-app-updates-helper:1.0.2"
You'll also need to add support for Java 8 in your project. To do so:
<details open><summary>Groovy</summary>

```groovy
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
```
}
```
</details>

## Example usage
<details><summary>Kotlin</summary>

```kotlin
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
```
</details>

## How to use
* Create a new _AppUpdatesHelper_.
* Start listening for app update changes with _AppUpdatesHelper.startListening()_, for example in _onCreate()_.
* Stop listening for app update changes with _AppUpdatesHelper.stopListening()_ in _onDestroy()_.
* Start listening for app update changes with _AppUpdatesHelper.startListening()_, for example in _Activity.onCreate()_ or in _Fragment.onViewCreated()_.
* Stop listening for app update changes with _AppUpdatesHelper.stopListening()_ in _Activity.onDestroy()_ or in _Fragment.onDestroyView()_.
* Request app update information with _AppUpdatesHelper.getAppUpdateInfo()_.
* Request a flexible or immediate update with _AppUpdatesHelper.startFlexibleUpdate()_ or _AppUpdatesHelper.startImmediateUpdate()_

Check the [example app](app) for more implementation details about [flexible](app/src/main/kotlin/com/bq/appupdateshelper/flexible/FlexibleUpdateActivity.kt)
and [immediate](app/src/main/kotlin/com/bq/appupdateshelper/immediate/ImmediateUpdateActivity.kt) updates.

If you use the example app, don't forget the following things when testing:
* Change the package name of the example app to the one you'd like to test in-app updates with.
* Sign the example app with the same keys that you used to sign the app you want to test in-app updates with.
* If the app is not published yet, or you want to test with internal app sharing or closed tracks, ensure that any of your Google accounts in your device has access to said app in Google Play Store.

You can also use a [fake implementation](app/src/main/kotlin/com/bq/appupdateshelper/fake/FakeUpdateActivity.kt) to test in-app updates.

Keep in mind that you may not see in-app updates if these conditions don't match:
* The package name of the app is **exactly** the one you'd like to test in-app updates with.
* The app must be signed with the same keys that you used to sign the app you want to test in-app updates with.
* If the app is not published yet or you want to test with internal app sharing or closed tracks,
ensure that any of your Google accounts in your device has access to said app in Google Play Store.
* Check if the Google Play Store displays updates for the app you want to use to test in-app updates.

Please ensure that all conditions apply when using this library in order to avoid unnecessary headaches.

### Using the example app
In order to ease using the example app with the sample data of your own app,
you can create an `app_config.properties` file in the root of the project with the following content:
```properties
applicationId=your.application.id
keystorePath=/full/path/to/your/keystore/file
keystorePwd=your_keystore_password
keystoreAlias=your_keystore_alias
keystoreAliasPwd=your_keystore_alias_password
```

These values will be picked up by the compilation process of the example app
and will set the application ID and signing configurations for you.

## Authors & Collaborators
* [Adrián García](https://github.com/adriangl) - Author and maintainer
* [Daniel Sánchez Ceinos](https://github.com/danielceinos) - Contributor
* **[Adrián García](https://github.com/adriangl)** - *Author and maintainer*
* **[Daniel Sánchez Ceinos](https://github.com/danielceinos)** - *Contributor*

## License
This project is licensed under the Apache Software License, Version 2.0.
```
Copyright (C) 2019 BQ

Expand Down
Loading