Skip to content
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

Android push implementation. #308

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ec55652
Create platform (java vs android) variants of AblyRest base library c…
paddybyers Nov 21, 2018
64077c9
Skeleton for support for network connectivity events
paddybyers Jul 31, 2018
7dda4e5
Implement support for Android network connectivity events
paddybyers Nov 21, 2018
ec1e3d2
Add Platform.getAblyForContext() on android
paddybyers Nov 21, 2018
ec0880e
Serialization.Http* can convert to any JSON-decoding class.
tcard Feb 18, 2017
6ec1e33
WIP: Android push implementation.
tcard Feb 6, 2017
207a523
Fixes to build to export Android dependencies without Maven.
tcard May 31, 2017
02911ef
Remove all "Created by tcard" comments.
tcard Oct 3, 2017
9f4727c
Push.* tests.
tcard Oct 3, 2017
0107532
A bunch of helpers methods, classes, etc. to use in push tests.
tcard Nov 1, 2017
cc0868a
Implement Push.ActivationStateMachine.reset for use in tests.
tcard Nov 1, 2017
385b85c
Increase visibility all around, for push tests.
tcard Nov 1, 2017
d1001f6
RawHttpListener: now you can provide a mock response to HTTP requests.
tcard Nov 1, 2017
d17a768
Add getMachine function to mock ActivationStateMachine in tests.
tcard Nov 1, 2017
34a595e
Random fixes to push code.
tcard Nov 1, 2017
63345a4
Allow specifying a custom, overriding Authorization header.
tcard Nov 1, 2017
78452e6
Better logging for push tests.
tcard Nov 1, 2017
b504be0
Add RawHttpTracker.lockRequests and getRequestWaiter for use in tests.
tcard Nov 1, 2017
8f3a877
Add pushFullWait option for setting fullWait param to push requests.
tcard Nov 1, 2017
360649c
Add tests for Android push.
tcard Nov 1, 2017
f20d8b7
Test that the realtime push interface is there.
tcard Nov 2, 2017
849cd08
Add device and subscription to eliminate test interference
paddybyers Jul 27, 2018
f22fd3d
Use a separate REST API instance to admin ops for activation tests
paddybyers Jul 31, 2018
a6c102e
Update android build tools version
paddybyers Jul 31, 2018
a10cb3c
Fix whitespace
paddybyers Aug 1, 2018
42bb13e
Migration to latest push spec
paddybyers Aug 1, 2018
da3230a
Fix whitespace
paddybyers Dec 5, 2018
c37fe19
Fix whitespace
paddybyers Dec 5, 2018
1f88b8b
Refactor push and platform-specific library structure; update android
paddybyers Dec 5, 2018
f5c7907
Refactor android push tests to reinitialise activation state before
paddybyers Dec 6, 2018
983ac78
Fix rebase errors
paddybyers Dec 7, 2018
7963b01
Ensure reset() only attempts to process own-delared fields
paddybyers Dec 11, 2018
5655ff5
Remove redundant messages
paddybyers Dec 11, 2018
b97b20d
Add AblyRest.device()
paddybyers Dec 11, 2018
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
35 changes: 24 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

Expand All @@ -14,9 +16,16 @@ ext {
artifactId = 'ably-android'
}

allprojects {
repositories {
jcenter()
google()
}
}

android {
compileSdkVersion 22
buildToolsVersion '27.0.3'
buildToolsVersion '28.0.3'

defaultConfig {
buildConfigField 'String', 'LIBRARY_NAME', '"android"'
Expand All @@ -27,8 +36,10 @@ android {
versionName version
setProperty("archivesBaseName", "ably-android-$versionName")
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArgument "class", "io.ably.lib.test.rest.RestSuite,io.ably.lib.test.realtime.RealtimeSuite,io.ably.lib.test.android.AndroidSuite"
testInstrumentationRunnerArgument "timeout_msec", "150000"
testInstrumentationRunnerArgument "class", "io.ably.lib.test.android.AndroidPushTest"
//testInstrumentationRunnerArgument "class", "io.ably.lib.test.rest.RestSuite,io.ably.lib.test.realtime.RealtimeSuite,io.ably.lib.test.android.AndroidSuite,io.ably.lib.test.android.AndroidPushTest"
testInstrumentationRunnerArgument "timeout_msec", "300000"
// testInstrumentationRunnerArgument "ABLY_ENV", "\"$System.env.ABLY_ENV\""
consumerProguardFiles 'proguard.txt'
}

Expand Down Expand Up @@ -70,18 +81,20 @@ tasks.withType(com.android.build.gradle.internal.tasks.AndroidTestTask) { task -
}

apply from: '../dependencies.gradle'
apply from: './dependencies.gradle'
dependencies {
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile "com.crittercism.dexmaker:dexmaker:1.4"
androidTestCompile "com.crittercism.dexmaker:dexmaker-dx:1.4"
androidTestCompile "com.crittercism.dexmaker:dexmaker-mockito:1.4"
implementation 'com.google.firebase:firebase-messaging:17.3.4'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test:rules:0.5'
androidTestImplementation "com.crittercism.dexmaker:dexmaker:1.4"
androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:1.4"
androidTestImplementation "com.crittercism.dexmaker:dexmaker-mockito:1.4"
}

configurations {
all*.exclude group: 'org.hamcrest', module: 'hamcrest-core'
androidTestCompile {
extendsFrom testCompile
androidTestImplementation {
extendsFrom testImplementation
}
}

Expand Down
3 changes: 3 additions & 0 deletions android/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies {
implementation 'io.azam.ulidj:ulidj:[1.0,2.0['
}
9 changes: 8 additions & 1 deletion android/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ uploadArchives {
}
}

// Exclude dependency on lib subproject.
pom.whenConfigured {
p -> p.dependencies = p.dependencies.findAll {
// Exclude dependency on lib subproject.
dep -> dep.artifactId != "lib"
}.findAll {
// Exclude Google services since we don't want to impose a particular
// version on users. Ideally we would specify a version range,
// but the Google services Gradle plugin doesn't seem to
// support that.
// TODO: Make sure this works when installing from Maven!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this TODO be resolved before we merge?

dep -> dep.artifactId != 'play-services-gcm' && dep.artifactId != 'firebase-messaging'
}
}

Expand Down
2 changes: 2 additions & 0 deletions android/proguard.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
-keep class io.ably.lib.types.** {*;}
-keep class org.msgpack.core.** {*;}
-keepclasseswithmembers class io.ably.lib.rest.Auth** {*;}
-keep class com.google.gson.** {*;}
-keep class io.azam.ulidj.** {*;}
-dontwarn org.msgpack.core.buffer.**
Loading