Skip to content

Commit f910c98

Browse files
committed
OneSignal SDK initial commit.
0 parents  commit f910c98

File tree

94 files changed

+10915
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+10915
-0
lines changed

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
8+
# Ignore all logfiles and tempfiles.
9+
/log/*.log
10+
/tmp
11+
12+
# built application files
13+
*.apk
14+
*.ap_
15+
16+
# files for the dex VM
17+
*.dex
18+
19+
# Java class files
20+
*.class
21+
22+
# generated files
23+
bin/
24+
gen/
25+
26+
# Proguard folder generated by Eclipse
27+
proguard/

LICENSE

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Modified MIT License
2+
3+
Copyright 2015 OneSignal
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
1. The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
2. All copies of substantial portions of the Software may only be used in connection
16+
with services provided by OneSignal.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
THE SOFTWARE.
25+
26+
Includes portions from the Google GcmClient demo project:
27+
Copyright 2013 Google Inc.
28+
29+
Licensed under the Apache License, Version 2.0 (the "License");
30+
you may not use this file except in compliance with the License.
31+
You may obtain a copy of the License at
32+
33+
http://www.apache.org/licenses/LICENSE-2.0
34+
35+
Unless required by applicable law or agreed to in writing, software
36+
distributed under the License is distributed on an "AS IS" BASIS,
37+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38+
See the License for the specific language governing permissions and
39+
limitations under the License.
40+
41+
Includes Android Asynchronous Http Client:
42+
Android Asynchronous Http Client
43+
Copyright (c) 2011 James Smith <james@loopj.com>
44+
http://loopj.com
45+
46+
Licensed under the Apache License, Version 2.0 (the "License");
47+
you may not use this file except in compliance with the License.
48+
You may obtain a copy of the License at
49+
50+
http://www.apache.org/licenses/LICENSE-2.0
51+
52+
Unless required by applicable law or agreed to in writing, software
53+
distributed under the License is distributed on an "AS IS" BASIS,
54+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55+
See the License for the specific language governing permissions and
56+
limitations under the License.
57+
58+
Includes portions from RootTools:
59+
Copyright (c) 2012 Stephen Erickson, Chris Ravenscroft, Dominik Schuermann, Adam Shanks
60+
61+
This code is dual-licensed under the terms of the Apache License Version 2.0 and
62+
the terms of the General Public License (GPL) Version 2.
63+
You may use this code according to either of these licenses as is most appropriate
64+
for your project on a case-by-case basis.
65+
66+
The terms of each license can be found at:
67+
68+
* http://www.apache.org/licenses/LICENSE-2.0
69+
* http://www.gnu.org/licenses/gpl-2.0.txt
70+
71+
Unless required by applicable law or agreed to in writing, software
72+
distributed under these Licenses is distributed on an "AS IS" BASIS,
73+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74+
See each License for the specific language governing permissions and
75+
limitations under that License.

OneSignalExample/.classpath

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
4+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
5+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
6+
<classpathentry kind="src" path="src"/>
7+
<classpathentry kind="src" path="gen"/>
8+
<classpathentry exported="true" kind="lib" path="../OneSignalSDK/bin/onesignalsdk.jar"/>
9+
<classpathentry kind="output" path="bin/classes"/>
10+
</classpath>

OneSignalExample/.project

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>OneSignalExample</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:amazon="http://schemas.amazon.com/apk/res/android"
4+
package="com.onesignal.example"
5+
android:versionCode="1"
6+
android:versionName="1.0" >
7+
8+
<uses-sdk
9+
android:minSdkVersion="9"
10+
android:targetSdkVersion="19" />
11+
12+
<!-- ##START## OneSignal Permissions -->
13+
14+
<!-- INTERNET and amazon device messaging are basic requirements for push messages from Amazon. -->
15+
<uses-permission android:name="android.permission.INTERNET" />
16+
<uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
17+
18+
<!-- Create a unique permission for your app and use it so only your app can receive your OneSignal messages. -->
19+
<permission android:name="com.onesignal.example.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
20+
<uses-permission android:name="com.onesignal.example.permission.RECEIVE_ADM_MESSAGE" />
21+
22+
<!-- Required, makes sure notifications are delivered on time. -->
23+
<uses-permission android:name="android.permission.WAKE_LOCK" />
24+
25+
<!-- Required so the device vibrates on receiving a push notification.
26+
Vibration settings of the device still apply. -->
27+
<uses-permission android:name="android.permission.VIBRATE" />
28+
29+
<!-- ##END## OneSignal Permissions -->
30+
31+
<application
32+
android:icon="@drawable/ic_launcher"
33+
android:label="@string/app_name"
34+
android:theme="@style/AppTheme" >
35+
36+
<!-- Standard activity that starts when opening your app normally. -->
37+
<activity
38+
android:name="com.onesignal.example.MainActivity"
39+
android:label="@string/app_name"
40+
android:screenOrientation="portrait" >
41+
<intent-filter>
42+
<action android:name="android.intent.action.MAIN" />
43+
<category android:name="android.intent.category.LAUNCHER" />
44+
</intent-filter>
45+
</activity>
46+
47+
<!-- Application tag requirements below for OneSignal -->
48+
<!-- ##START## OneSignal -->
49+
<amazon:enable-feature android:name="com.amazon.device.messaging" android:required="false"/>
50+
51+
<activity android:name="com.onesignal.NotificationOpenedActivity"/>
52+
53+
<service android:name="com.onesignal.ADMMessageHandler" android:exported="false" />
54+
<receiver
55+
android:name="com.onesignal.ADMMessageHandler$Receiver"
56+
android:permission="com.amazon.device.messaging.permission.SEND" >
57+
58+
<intent-filter>
59+
<action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
60+
<action android:name="com.amazon.device.messaging.intent.RECEIVE" />
61+
<category android:name="com.onesignal.example" />
62+
</intent-filter>
63+
64+
</receiver>
65+
<!-- ##END## OneSignal -->
66+
67+
</application>
68+
</manifest>

OneSignalExample/AndroidManifest.xml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.onesignal.example"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="9"
9+
android:targetSdkVersion="21" />
10+
11+
<!-- ##START## OneSignal Permissions -->
12+
13+
<!-- INTERNET and c2dm RECEIVE are basic requirements for push messages from Google. -->
14+
<uses-permission android:name="android.permission.INTERNET" />
15+
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
16+
17+
<!-- Create a unique permission for your app and use it so only your app can receive your OneSignal messages. -->
18+
<permission android:name="com.onesignal.example.permission.C2D_MESSAGE" android:protectionLevel="signature" />
19+
<uses-permission android:name="com.onesignal.example.permission.C2D_MESSAGE" />
20+
21+
<!-- Required, makes sure notifications are delivered on time. -->
22+
<uses-permission android:name="android.permission.WAKE_LOCK" />
23+
24+
<!-- Required so the device vibrates on receiving a push notification.
25+
Vibration settings of the device still apply. -->
26+
<uses-permission android:name="android.permission.VIBRATE" />
27+
28+
<!-- ##END## OneSignal Permissions -->
29+
30+
<application
31+
android:icon="@drawable/ic_launcher"
32+
android:label="@string/app_name"
33+
android:theme="@style/AppTheme" >
34+
35+
<!-- Standard activity that starts when opening your app normally. -->
36+
<activity
37+
android:name="com.onesignal.example.MainActivity"
38+
android:label="@string/app_name"
39+
android:screenOrientation="portrait" >
40+
<intent-filter>
41+
<action android:name="android.intent.action.MAIN" />
42+
<category android:name="android.intent.category.LAUNCHER" />
43+
</intent-filter>
44+
</activity>
45+
46+
<!-- Application tag requirements below for OneSignal -->
47+
<!-- ##START## OneSignal -->
48+
<meta-data android:name="com.google.android.gms.version"
49+
android:value="@integer/google_play_services_version" />
50+
51+
<activity android:name="com.onesignal.NotificationOpenedActivity"/>
52+
53+
<receiver
54+
android:name="com.onesignal.GcmBroadcastReceiver"
55+
android:permission="com.google.android.c2dm.permission.SEND" >
56+
<intent-filter>
57+
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
58+
<category android:name="com.onesignal.example" />
59+
</intent-filter>
60+
</receiver>
61+
<service android:name="com.onesignal.GcmIntentService" />
62+
63+
<!-- Optional receiver to get OneSignal Background Data Notifications. -->
64+
<receiver
65+
android:name="com.onesignal.example.BackgroundDataBroadcastReceiver"
66+
android:exported="false">
67+
<intent-filter>
68+
<action android:name="com.onesignal.BackgroundBroadcast.RECEIVE" />
69+
</intent-filter>
70+
</receiver>
71+
<!-- ##END## OneSignal -->
72+
73+
</application>
74+
</manifest>

OneSignalExample/assets/api_key.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
eyJhbGciOiJSU0EtU0hBMjU2IiwidmVyIjoiMSJ9.eyJhcHBGYW1pbHlJZCI6ImFtem4xLmFwcGxpY2F0aW9uLmFhYTdlZWRmNmZjNDQyNTNiZjYwMzk4NTdiZGIwYmZlIiwiaWQiOiIxNzc5M2ZkMy04MGRjLTExZTQtYmFhMi1jN2QyZTMxMGUzZDciLCJhcHBJZCI6ImFtem4xLmFwcGxpY2F0aW9uLWNsaWVudC42YjMwODIyN2FmZDE0NmQ2OTYwZTA3YTczODgwNzA5ZSIsImVuZHBvaW50cyI6eyJhdXRoeiI6Imh0dHBzOi8vd3d3LmFtYXpvbi5jb20vYXAvb2EiLCJ0b2tlbkV4Y2hhbmdlIjoiaHR0cHM6Ly9hcGkuYW1hem9uLmNvbS9hdXRoL28yL3Rva2VuIn0sImlzcyI6IkFtYXpvbiIsInBrZyI6ImNvbS5oaXB0aWMuZ2FtZXRocml2ZWV4YW1wbGUiLCJ0cnVzdFBvb2wiOm51bGwsInZlciI6IjMiLCJhcHBWYXJpYW50SWQiOiJhbXpuMS5hcHBsaWNhdGlvbi1jbGllbnQuNmIzMDgyMjdhZmQxNDZkNjk2MGUwN2E3Mzg4MDcwOWUiLCJ0eXBlIjoiQVBJS2V5IiwiaWF0IjoiMTQxODI2NDM1MDMwOSIsImNsaWVudElkIjoiYW16bjEuYXBwbGljYXRpb24tb2EyLWNsaWVudC5lNTgyOTc1ZTg5NjQ0ZjE5YjI1ZTI3M2UzZTU0MGE5MiIsImFwcHNpZyI6IjExOjFEOjQ1OkQ5OjQyOjIwOkFCOkZDOkEwOkQ2OkI2OjREOkVGOjdBOkE3OjQ4In0=.frP3WoG+Zcl+GvQu0D/+sHISKIw0ub1/yXLdpVUFHAr11tszzI7gBCbE5YAEZqVVan6KOXFUkZfbN3A4cWkCEZZw7dla6e9TW5JFq9tbGkhIP1RsaUCn0a+DdI2EPY9R5/+YOc6GZTBeOViXDp9XMydAHtcy7ktzaSpedQ+z3Zm/Eysb16SL+QVJNm/dBLuo5kpUI4SUyy+fO9juva/Ibj/Ofvz/XquU6bolER/TpA3akweLGF9Hb+oks7LzoWYwsj4h9O6x8eO0btcxZoSvBm/63UYQTWdZV6sS7XKOc3rqmJbOCr39KJUA88pxuiUmAc5dZekn7eB9NUuccWmtgA==

OneSignalExample/proguard-project.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
21+
22+
-dontwarn com.gamethrive.**
23+
-dontwarn com.onesignal.**

OneSignalExample/project.properties

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-21
15+
android.library.reference.1=../../../../../../workspace/google-play-services_lib
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
tools:context="${packageName}.${activityClass}" >
6+
7+
<Button
8+
android:id="@+id/buttonTag"
9+
android:layout_width="wrap_content"
10+
android:layout_height="wrap_content"
11+
android:layout_centerHorizontal="true"
12+
android:layout_marginTop="23dp"
13+
android:onClick="sendTag"
14+
android:text="Send Tag" />
15+
16+
<Button
17+
android:id="@+id/ButtonGetIds"
18+
android:layout_width="wrap_content"
19+
android:layout_height="wrap_content"
20+
android:layout_below="@+id/buttonTag"
21+
android:layout_centerHorizontal="true"
22+
android:layout_marginTop="21dp"
23+
android:onClick="getIds"
24+
android:text="Get Ids" />
25+
26+
<TextView
27+
android:id="@+id/textViewIds"
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:layout_below="@+id/ButtonGetIds"
31+
android:layout_centerHorizontal="true"
32+
android:layout_marginTop="52dp" />
33+
34+
</RelativeLayout>
11.9 KB
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 11+. This theme completely replaces
5+
AppBaseTheme from res/values/styles.xml on API 11+ devices.
6+
-->
7+
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
8+
<!-- API 11 theme customizations can go here. -->
9+
</style>
10+
11+
</resources>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 14+. This theme completely replaces
5+
AppBaseTheme from BOTH res/values/styles.xml and
6+
res/values-v11/styles.xml on API 14+ devices.
7+
-->
8+
<style name="AppBaseTheme" parent="android:Theme.Light">
9+
<!-- API 14 theme customizations can go here. -->
10+
</style>
11+
12+
</resources>

0 commit comments

Comments
 (0)