Skip to content

Commit

Permalink
OneSignal Android Native SDK 2.0!
Browse files Browse the repository at this point in the history
* Network optimizations and offline support for tags, subscription setting, and getTags.
* Added geo tagging.
* Removed loopj library
   - Now uses the HttpURLConnection class which is built into the Android OS.
* Smaller SDK size
* Fixed Activity leak.
* Simpler setup, no longer need to add OneSignal.onResumed() and OneSignal.onPaused() to each activity.
   - The SDK now handles this for you automatically.
* New builder init pattern.
* OneSignal app id and Google project number now pulled from the AndroidManifest.xml.
  - Android Studio user can set these in the gradle file.
* Now support Android market:// links.
  - Now directly opens all links instead of opening your app first.

- Updating from 1.x.x
* Add the following to your gradle file:
    compile "com.google.android.gms:play-services-location:8.3.0"
    compile 'com.android.support:appcompat-v7:23.1.1'
* Update any calls to GameThrive with OneSignal.
  • Loading branch information
jkasten2 committed Dec 12, 2015
1 parent 8ebf4a2 commit ce5ad7d
Show file tree
Hide file tree
Showing 58 changed files with 4,823 additions and 986 deletions.
Binary file modified OneSignalSDK.jar
Binary file not shown.
84 changes: 26 additions & 58 deletions OneSignalSDK/app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_unit_test_" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugUnitTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugUnitTestSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<afterSyncTasks>
<task>generateDebugAndroidTestSources</task>
<task>generateDebugSources</task>
<task>mockableAndroidJar</task>
<task>prepareDebugUnitTestDependencies</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
Expand All @@ -29,7 +28,7 @@
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
Expand All @@ -38,86 +37,55 @@
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="shadows-core-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-utils-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-commons-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="vtd-xml-2.11" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-tree-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-analysis-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="icu4j-53.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="ant-1.8.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="accessibility-test-framework-1.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="ant-launcher-1.8.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="bcprov-jdk16-1.46" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-util-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-ant-tasks-2.1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="sqlite4java-0.282" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-resources-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-annotations-3.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
<orderEntry type="module" module-name="onesignal" exported="" />
<orderEntry type="library" exported="" name="org.apache.http.legacy-android-23" level="project" />
</component>
</module>
37 changes: 24 additions & 13 deletions OneSignalSDK/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

useLibrary 'org.apache.http.legacy'
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.onesignal.example"
manifestPlaceholders = [manifestApplicationId: "${applicationId}"]
manifestPlaceholders = [manifestApplicationId: "${applicationId}",
// onesignal_app_id: "5eb5a37e-b458-11e3-ac11-000c2940e62c",
onesignal_app_id: "b2f7f966-d8cc-11e4-bed1-df8f05be55ba",
onesignal_google_project_number: "703322744261"]
minSdkVersion 10
targetSdkVersion 23
versionCode 1
Expand All @@ -22,12 +23,16 @@ android {
}
testOptions {
unitTests.all {
maxParallelForks 4
maxParallelForks 1
maxHeapSize "2048m"
}
}
}

repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:+'
Expand All @@ -36,14 +41,20 @@ dependencies {
compile project(':onesignal')

// Use for released SDK
//compile 'com.onesignal:OneSignal:1.10.+@aar'
//compile 'com.google.android.gms:play-services-gcm:7.3.+'
//compile 'com.google.android.gms:play-services-analytics:7.3.+'

testCompile 'junit:junit:4.12'
// testCompile 'org.robolectric:shadows-support-v4:3.0'
testCompile('org.robolectric:robolectric:3.0') {
exclude group: 'commons-logging', module: 'commons-logging'
//compile 'com.onesignal:OneSignal:2.+@aar'
//compile "com.google.android.gms:play-services-gcm:8.3.0"
//compile "com.google.android.gms:play-services-analytics:8.3.0"
//compile "com.google.android.gms:play-services-location:8.3.0"
//compile 'com.android.support:appcompat-v7:23.1.1'

// testCompile 'junit:junit:4.12'
// testCompile 'org.robolectric:shadows-support-v4:3.0'
// testCompile('org.robolectric:robolectric:3.0') {
// exclude group: 'commons-logging', module: 'commons-logging'
// exclude group: 'org.apache.httpcomponents', module: 'httpclient'
// }

testCompile("org.robolectric:robolectric:3.1-SNAPSHOT") {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
}
48 changes: 43 additions & 5 deletions OneSignalSDK/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:amazon="http://schemas.amazon.com/apk/res/android"
package="com.onesignal.example" >

<uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
<permission android:name="com.onesignal.example.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.onesignal.example.permission.RECEIVE_ADM_MESSAGE" />
<uses-permission android:name="com.android.vending.BILLING" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!--<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>-->


<application
android:allowBackup="true"
Expand All @@ -28,14 +29,51 @@
-->






<!--
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:taskAffinity="">
</activity>
<activity
android:name=".BlankActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:taskAffinity=""
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
-->

<activity
android:name=".MainActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
</activity>

<activity
android:name=".BlankActivity"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>




<activity
android:name=".MainActivity2Activity"
android:label="@string/title_activity_main_activity2"
Expand Down
Loading

0 comments on commit ce5ad7d

Please sign in to comment.