Skip to content

Commit

Permalink
Merge pull request #18 from argyle-systems/update-project
Browse files Browse the repository at this point in the history
Update README and dependencies
  • Loading branch information
MindaugasVarkalys authored Aug 1, 2024
2 parents f7d57af + eddd11a commit b99abba
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,29 @@

![jitpack](https://maven-badges.herokuapp.com/maven-central/com.argyle/argyle-link-android/badge.svg)

Argyle’s Android Link SDK provides a way to integrate [Link](https://docs.argyle.com/guides/docs/argyle-link-overview) into your Android app.

First-time installation instructions are below. To update versions, visit our [upgrade guide](https://github.com/argyle-systems/argyle-link-android/blob/master/UPGRADING.md).
Argyle’s Android Link SDK provides a way to integrate [Link](https://argyle.com/docs/link/overview) into your Android app.

**Requirements:**

- Android 8.0 (API level 26) and above
- Kotlin `1.7.10+`
- Android Gradle Plugin `7.2+`
- Gradle `7.2+`
```
android {
compileSdk 34
defaultConfig {
minSdk 26
...
}
...
}
```

## Installing the SDK


1. Add the following line within the dependencies of your `build.gradle` [configuration file](https://developer.android.com/studio/build#top-level):

```kotlin
1. Add the following line within the dependencies of your app `build.gradle` [configuration file](https://developer.android.com/build/dependencies#add-dependencies-without-catalogs):
```groovy
dependencies {
implementation 'com.argyle:argyle-link-android:5.x.x'
implementation 'com.argyle:argyle-link-android:5.+'
}
```

1. [Sync your Android project](https://developer.android.com/studio/build#sync-files) to import the build configuration changes

### Notes

- Starting with Link `4.7.3` we dropped JitPack as means of distribution in favor of [Maven Central](https://central.sonatype.dev/).
- If you are using tools like ProGuard to obfuscate your code…
- Make sure to exclude the Link SDK package `com.argyle.*`
- For example, add the following line to the `proguard-rules.pro` file of your ProGuard configuration:

```
-keep class com.argyle. { *; }
```
2. [Sync your Android project](https://developer.android.com/build#sync-files) to import the build configuration changes

## Implementing Link

Expand All @@ -45,12 +33,12 @@ dependencies {
2. Create a user token:
- **New users**
1. Create a new user by sending a **POST** to the [users endpoint](https://docs.argyle.com/guides/reference/create-a-user) of the Argyle API
2. The response payload will include an `id` and `user_token`
3. Save the `id` for quickly creating user tokens for this user in the future
2. The response payload will include an `id` and `user_token`
3. Save the `id` for quickly creating user tokens for this user in the future
4. Initialize Link by passing the `user_token` as the value for the `userToken` parameter
- **Returning users**
1. Send a **POST** request to the [user-tokens endpoint](https://docs.argyle.com/guides/reference/create-a-user-token) of the Argyle API
- Include the `id` of the user in the request body as a JSON object in the format `{"user": "<id>"}`
- Include the `id` of the user in the request body as a JSON object in the format `{"user": "<id>"}`
2. A `user_token` will be included in the response payload
3. Initialize Link by passing the `user_token` as the value for the `userToken` parameter
1. Initialize Link using the Link key and user token.
Expand Down Expand Up @@ -84,7 +72,7 @@ config.onDDSError = { data ->
Log.d("Result", "onDDSError $data")
}
config.onTokenExpired = { handler ->
// generate your new token here
// generate your new token here
// handler(newToken)
}

Expand Down
69 changes: 0 additions & 69 deletions UPGRADING.md

This file was deleted.

17 changes: 9 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,44 @@ plugins {

android {
namespace 'com.argyleexample'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.argyleexample"
minSdk 26
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_11.toString()
}

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation 'com.argyle:argyle-link-android:5.3.0'
implementation 'com.argyle:argyle-link-android:5.+'

testImplementation 'junit:junit:4.13.2'
}
2 changes: 0 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class com.argyle.** { *; }
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildscript {
ext {
kotlin_version = '1.8.0'
kotlin_version = '1.9.25'
}

repositories {
Expand All @@ -11,7 +11,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.android.tools.build:gradle:8.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ android.enableJetifier=true

# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Jul 04 23:14:55 EEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit b99abba

Please sign in to comment.