├── .gitignore ├── LICENSE.txt ├── README.md ├── art ├── properties.png ├── schedule.gif └── sendnow.gif ├── build.gradle ├── demo ├── .gitignore ├── build.gradle ├── libs │ └── Parse-1.9.4.jar ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── bowyer │ │ └── app │ │ └── parsesendclient │ │ └── demo │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── bowyer │ │ └── app │ │ └── parsesendclient │ │ └── demo │ │ ├── DemoApplication.java │ │ ├── DemoParsePushBroadcastReceiver.java │ │ ├── MainActivity.java │ │ ├── WebViewActivity.java │ │ ├── constant │ │ └── EnvConst.java │ │ ├── logic │ │ └── ParseLogic.java │ │ └── model │ │ └── ParsePushModel.java │ ├── res │ ├── layout │ │ ├── activity_main.xml │ │ └── activity_web.xml │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ ├── values-w820dp │ │ └── dimens.xml │ └── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── resources │ └── parsepush.properties ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── parsesendclient ├── .gitignore ├── bintray-publish.gradle ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── bowyer │ │ └── app │ │ └── parsesendclient │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── bowyer │ │ └── app │ │ └── parsesendclient │ │ ├── Api.java │ │ ├── ApiCreater.java │ │ ├── BetterLog.java │ │ ├── DateUtil.java │ │ ├── EnvConst.java │ │ ├── ParsePushDto.java │ │ └── PushSendLogic.java │ └── res │ └── values │ └── strings.xml ├── senddemo ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── bowyer │ │ └── app │ │ └── parsesendclient │ │ └── senddemo │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── bowyer │ │ └── app │ │ └── parsesendclient │ │ └── senddemo │ │ ├── PushSendActivity.java │ │ └── model │ │ └── ParsePushModel.java │ ├── res │ ├── layout │ │ └── activity_push_send.xml │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ ├── values-w820dp │ │ └── dimens.xml │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── resources │ └── parsepush.properties └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | ### Android template 2 | # Built application files 3 | *.apk 4 | *.ap_ 5 | 6 | # Files for the Dalvik VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | /*/build/ 20 | 21 | # Local configuration file (sdk path, etc) 22 | local.properties 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | 31 | ### JetBrains template 32 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion 33 | 34 | *.iml 35 | 36 | ## Directory-based project format: 37 | .idea/ 38 | # if you remove the above rule, at least ignore the following: 39 | 40 | # User-specific stuff: 41 | # .idea/workspace.xml 42 | # .idea/tasks.xml 43 | # .idea/dictionaries 44 | 45 | # Sensitive or high-churn files: 46 | # .idea/dataSources.ids 47 | # .idea/dataSources.xml 48 | # .idea/sqlDataSources.xml 49 | # .idea/dynamic.xml 50 | # .idea/uiDesigner.xml 51 | 52 | # Gradle: 53 | # .idea/gradle.xml 54 | # .idea/libraries 55 | 56 | # Mongo Explorer plugin: 57 | # .idea/mongoSettings.xml 58 | 59 | ## File-based project format: 60 | *.ipr 61 | *.iws 62 | 63 | ## Plugin-specific files: 64 | 65 | # IntelliJ 66 | /out/ 67 | 68 | # mpeltonen/sbt-idea plugin 69 | .idea_modules/ 70 | 71 | # JIRA plugin 72 | atlassian-ide-plugin.xml 73 | 74 | # Crashlytics plugin (for Android Studio and IntelliJ) 75 | com_crashlytics_export_strings.xml 76 | crashlytics.properties 77 | crashlytics-build.properties 78 | 79 | 80 | ### OSX template 81 | .DS_Store 82 | .AppleDouble 83 | .LSOverride 84 | 85 | # Icon must end with two \r 86 | Icon 87 | 88 | # Thumbnails 89 | ._* 90 | 91 | # Files that might appear in the root of a volume 92 | .DocumentRevisions-V100 93 | .fseventsd 94 | .Spotlight-V100 95 | .TemporaryItems 96 | .Trashes 97 | .VolumeIcon.icns 98 | 99 | # Directories potentially created on remote AFP share 100 | .AppleDB 101 | .AppleDesktop 102 | Network Trash Folder 103 | Temporary Items 104 | .apdisk 105 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Bowyer 2 | Released under the MIT license 3 | http://opensource.org/licenses/mit-license.php 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ParseSendClient( Depricated ) 2 | ============================== 3 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ParseSendClient-green.svg?style=flat)](https://android-arsenal.com/details/1/2227) 4 | 5 | Parse push send client. 6 | 7 | Use Parse REST API Push Notifications 8 | 9 | [Parse REST API](https://parse.com/docs/rest/guide/#quick-reference-push-notifications) 10 | 11 | ![Demo send now](./art/sendnow.gif) 12 | ![Demo sckeduling](./art/schedule.gif) 13 | 14 | Usage 15 | ==== 16 | Create notification Object 17 | 18 | ```java 19 | ParsePushModel model = ParsePushModel.to().setTitle(pushTitle).setMessage( 20 | pushMessage).setUrl(pushUrl); 21 | ``` 22 | 23 | Create channel 24 | 25 | ```java 26 | String[] channel = new String[1]; 27 | channel[0] = "demo"; 28 | ``` 29 | 30 | Send push now. 31 | 32 | ```java 33 | PushSendLogic.sendPush(model, channel, new PushSendLogic.PushSendCallBack() { 34 | @Override 35 | public void onSuccess() { 36 | 37 | } 38 | 39 | @Override 40 | public void onFailure(String message) { 41 | 42 | } 43 | 44 | }); 45 | ``` 46 | 47 | Send scheduling push. 48 | 49 | ```java 50 | Calendar calendar = Calendar.getInstance(); 51 | //set push date 52 | calendar.set(year, monthOfYear, dayOfMonth); 53 | //set push time 54 | calendar.set(Calendar.HOUR_OF_DAY, hourOfDay); 55 | calendar.set(Calendar.MINUTE, minute); 56 | //call sendSchedulingPush 57 | PushSendLogic.sendSchedulingPush(model, calendar, channel, 58 | new PushSendLogic.PushSendCallBack() { 59 | @Override 60 | public void onSuccess() { 61 | 62 | } 63 | 64 | @Override 65 | public void onFailure(String message) { 66 | } 67 | }); 68 | ``` 69 | 70 | Here's Custom push Object 71 | 72 | ```java 73 | public class ParsePushModel { 74 | 75 | String title; 76 | 77 | String message; 78 | 79 | String url; 80 | 81 | public ParsePushModel to() { 82 | return new ParsePushModel(); 83 | } 84 | 85 | public ParsePushModel setTitle(String title) { 86 | this.title = title; 87 | return this; 88 | } 89 | 90 | public ParsePushModel setMessage(String message) { 91 | this.message = message; 92 | return this; 93 | } 94 | 95 | public ParsePushModel setUrl(String url) { 96 | this.url = url; 97 | return this; 98 | } 99 | 100 | public String getTitle() { 101 | return title; 102 | } 103 | 104 | public String getMessage() { 105 | return message; 106 | } 107 | 108 | public String getUrl() { 109 | return url; 110 | } 111 | 112 | } 113 | ``` 114 | 115 | Download 116 | ==== 117 | Download via Gradle: 118 | 119 | ``` 120 | repositories { 121 | maven { 122 | jcenter() 123 | } 124 | } 125 | 126 | dependencies { 127 | compile 'com.bowyer.app:parsesendclient:0.1.0@aar' 128 | compile 'com.squareup.retrofit:retrofit:1.9.0' 129 | compile 'com.google.code.gson:gson:1.7.2' 130 | compile 'com.squareup.okhttp:okhttp:2.2.0' 131 | compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0' 132 | } 133 | ``` 134 | 135 | # parsepush.properties 136 | 137 | add parsepush.properties into resources dir 138 | 139 | | property | description | 140 | | ------------- | ------------- | 141 | | PARSE_APPLICATION_ID | your Application ID | 142 | | PARSE_REST_API_KEY | your Client Key | 143 | | PARSE_REST_API_KEY | your REST API Key | 144 | 145 | ![Parse](./art/properties.png) 146 | License 147 | -------- 148 | ``` 149 | Copyright (c) 2015 Bowyer 150 | Released under the MIT license 151 | http://opensource.org/licenses/mit-license.php 152 | ``` 153 | -------------------------------------------------------------------------------- /art/properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/art/properties.png -------------------------------------------------------------------------------- /art/schedule.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/art/schedule.gif -------------------------------------------------------------------------------- /art/sendnow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/art/sendnow.gif -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.2.3' 9 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' 10 | classpath 'com.github.dcendents:android-maven-plugin:1.2' 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | jcenter() 19 | mavenCentral() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /demo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion COMPILE_SDK_VERSION as int 5 | buildToolsVersion BUILD_TOOLS_VERSION 6 | 7 | defaultConfig { 8 | applicationId "com.bowyer.app.parsesendclient.demo" 9 | minSdkVersion MIN_SDK_VERSION 10 | targetSdkVersion TARGET_SDK_VERSION as int 11 | versionCode VERSION_CODE as int 12 | versionName VERSION_NAME 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | //push 25 | compile 'com.parse.bolts:bolts-android:1.+' 26 | compile fileTree(dir: 'libs', include: 'Parse-*.jar') 27 | compile project(':parsesendclient') 28 | //ui 29 | compile 'com.jakewharton:butterknife:6.1.0' 30 | compile 'com.android.support:appcompat-v7:22.2.1' 31 | compile 'com.github.citux:datetimepicker:0.1.2' 32 | } 33 | -------------------------------------------------------------------------------- /demo/libs/Parse-1.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/demo/libs/Parse-1.9.4.jar -------------------------------------------------------------------------------- /demo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/a13089/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /demo/src/androidTest/java/com/bowyer/app/parsesendclient/demo/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | 11 | public ApplicationTest() { 12 | super(Application.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 50 | 51 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /demo/src/main/java/com/bowyer/app/parsesendclient/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo; 2 | 3 | import com.bowyer.app.parsesendclient.demo.logic.ParseLogic; 4 | 5 | import android.app.Application; 6 | 7 | /** 8 | * Created by Bowyer on 2015/08/02. 9 | */ 10 | public class DemoApplication extends Application { 11 | 12 | @Override 13 | public void onCreate() { 14 | super.onCreate(); 15 | ParseLogic.ParseInit(getApplicationContext()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /demo/src/main/java/com/bowyer/app/parsesendclient/demo/DemoParsePushBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo; 2 | 3 | import com.google.gson.Gson; 4 | 5 | import com.bowyer.app.parsesendclient.demo.model.ParsePushModel; 6 | import com.parse.ParsePushBroadcastReceiver; 7 | 8 | import android.app.Notification; 9 | import android.app.NotificationManager; 10 | import android.app.PendingIntent; 11 | import android.content.Context; 12 | import android.content.Intent; 13 | import android.content.pm.ApplicationInfo; 14 | import android.content.pm.PackageManager; 15 | import android.media.AudioManager; 16 | import android.os.Bundle; 17 | import android.support.v4.app.NotificationCompat; 18 | import android.text.TextUtils; 19 | 20 | /** 21 | * Created by Bowyer on 2015/08/02. 22 | */ 23 | public class DemoParsePushBroadcastReceiver extends ParsePushBroadcastReceiver { 24 | 25 | private ParsePushModel mPushModel; 26 | private int VLUME_SIZE = 2;//sound size 27 | 28 | public void onPushReceive(final Context context, Intent intent) { 29 | Bundle extra = intent.getExtras(); 30 | String data = extra.getString("com.parse.Data"); 31 | mPushModel = new Gson().fromJson(data, ParsePushModel.class); 32 | 33 | Notification notification = generateNotification(context, intent.getExtras()); 34 | NotificationManager notificationManager = (NotificationManager) context 35 | .getSystemService(Context.NOTIFICATION_SERVICE); 36 | notificationManager.notify(context.getPackageName(), 1, 37 | notification); 38 | } 39 | 40 | 41 | public Notification generateNotification(Context context, Bundle extras) { 42 | 43 | PackageManager packageManager = context.getPackageManager(); 44 | 45 | int icon = 0; 46 | String title = mPushModel.getTitle(); 47 | boolean forceSound = mPushModel.forceSound(); 48 | 49 | if (forceSound) { 50 | //if true force sound. 51 | AudioManager manager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); 52 | 53 | int maxvolume = manager.getStreamMaxVolume(AudioManager.STREAM_RING); 54 | 55 | manager.setStreamVolume(AudioManager.STREAM_RING, maxvolume / VLUME_SIZE, 56 | AudioManager.FLAG_VIBRATE); 57 | } 58 | try { 59 | ApplicationInfo applicationInfo = packageManager 60 | .getApplicationInfo(context.getPackageName(), 0); 61 | icon = packageManager.getApplicationInfo(context.getPackageName(), 0).icon; 62 | if (TextUtils.isEmpty(title)) { 63 | title = packageManager.getApplicationLabel(applicationInfo).toString(); 64 | } 65 | } catch (PackageManager.NameNotFoundException e) { 66 | } 67 | 68 | String message = mPushModel.getMessage(); 69 | 70 | Intent intent = new Intent(context, MainActivity.class); 71 | intent.putExtras(extras); 72 | 73 | PendingIntent pendingIntent = PendingIntent 74 | .getActivity(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); 75 | 76 | NotificationCompat.Builder builder = new NotificationCompat.Builder(context); 77 | builder.setTicker(title); 78 | builder.setSmallIcon(icon); 79 | builder.setContentTitle(title); 80 | builder.setContentText(message); 81 | builder.setContentIntent(pendingIntent); 82 | builder.setWhen(System.currentTimeMillis()); 83 | builder.setAutoCancel(true); 84 | 85 | builder.setDefaults(Notification.DEFAULT_VIBRATE 86 | | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_SOUND); 87 | return builder.build(); 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /demo/src/main/java/com/bowyer/app/parsesendclient/demo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo; 2 | 3 | import com.google.gson.Gson; 4 | 5 | import com.bowyer.app.parsesendclient.demo.model.ParsePushModel; 6 | 7 | import android.os.Bundle; 8 | import android.support.v7.app.ActionBarActivity; 9 | import android.text.TextUtils; 10 | import android.view.View; 11 | import android.widget.LinearLayout; 12 | import android.widget.TextView; 13 | 14 | import butterknife.ButterKnife; 15 | import butterknife.InjectView; 16 | 17 | 18 | public class MainActivity extends ActionBarActivity { 19 | 20 | final String KEY = "com.parse.Data"; 21 | 22 | @InjectView(R.id.push_title) 23 | TextView mTitle; 24 | 25 | @InjectView(R.id.push_message) 26 | TextView mMessage; 27 | 28 | @InjectView(R.id.push_url) 29 | TextView mUrl; 30 | 31 | @InjectView(R.id.push_detail) 32 | LinearLayout mPushDetail; 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_main); 38 | ButterKnife.inject(this); 39 | initData(); 40 | } 41 | 42 | private void initData() { 43 | Bundle bundle = getIntent().getExtras(); 44 | if (bundle == null) { 45 | return; 46 | } 47 | String data = bundle.getString(KEY); 48 | if (TextUtils.isEmpty(data)) { 49 | return; 50 | } 51 | ParsePushModel model = new Gson().fromJson(data, ParsePushModel.class); 52 | mTitle.setText(model.getTitle()); 53 | mMessage.setText(model.getMessage()); 54 | mPushDetail.setVisibility(View.VISIBLE); 55 | String url = model.getUrl(); 56 | 57 | if (TextUtils.isEmpty(url)) { 58 | return; 59 | } 60 | mUrl.setText(url); 61 | WebViewActivity.startWebActivity(this, url); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /demo/src/main/java/com/bowyer/app/parsesendclient/demo/WebViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.graphics.Bitmap; 6 | import android.os.Bundle; 7 | import android.support.v4.widget.SwipeRefreshLayout; 8 | import android.support.v7.app.ActionBarActivity; 9 | import android.view.View; 10 | import android.webkit.WebView; 11 | import android.webkit.WebViewClient; 12 | import android.widget.ProgressBar; 13 | 14 | import butterknife.ButterKnife; 15 | import butterknife.InjectView; 16 | 17 | /** 18 | * Created by Bowyer on 15/08/07. 19 | */ 20 | public class WebViewActivity extends ActionBarActivity 21 | implements SwipeRefreshLayout.OnRefreshListener { 22 | 23 | public static final String KEY_URL = "key_url"; 24 | 25 | @InjectView(R.id.pull_reflesh) 26 | SwipeRefreshLayout mSwipeRefreshLayout; 27 | 28 | @InjectView(R.id.web_view) 29 | WebView mWebView; 30 | 31 | @InjectView(R.id.progress_bar) 32 | ProgressBar mProgressBar; 33 | 34 | String mUrl; 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | setContentView(R.layout.activity_web); 40 | ButterKnife.inject(this); 41 | mSwipeRefreshLayout.setOnRefreshListener(this); 42 | initWebView(); 43 | } 44 | 45 | private void initWebView() { 46 | Intent intent = getIntent(); 47 | mUrl = intent.getExtras().getString(KEY_URL); 48 | mWebView.loadUrl(mUrl); 49 | mWebView.setWebViewClient(new CustomWebViewClient()); 50 | mWebView.getSettings().setJavaScriptEnabled(true); 51 | } 52 | 53 | @Override 54 | public void onRefresh() { 55 | mWebView.reload(); 56 | } 57 | 58 | public static void startWebActivity(Context context, String url) { 59 | Intent intent = new Intent(context, WebViewActivity.class); 60 | intent.putExtra(KEY_URL, url); 61 | context.startActivity(intent); 62 | } 63 | 64 | class CustomWebViewClient extends WebViewClient { 65 | 66 | @Override 67 | public void onPageStarted(final WebView view, final String url, final Bitmap favicon) { 68 | super.onPageStarted(view, url, favicon); 69 | if (mProgressBar != null) { 70 | mProgressBar.setVisibility(View.VISIBLE); 71 | } 72 | } 73 | 74 | @Override 75 | public void onPageFinished(final WebView view, final String url) { 76 | super.onPageFinished(view, url); 77 | 78 | if (mProgressBar != null) { 79 | mProgressBar.setVisibility(View.GONE); 80 | } 81 | 82 | if (mSwipeRefreshLayout != null) { 83 | mSwipeRefreshLayout.setRefreshing(false); 84 | } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /demo/src/main/java/com/bowyer/app/parsesendclient/demo/constant/EnvConst.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo.constant; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | /** 6 | * Created by Bowyer on 2015/08/02. 7 | */ 8 | public class EnvConst { 9 | 10 | public static final ParseProperties PROPERTIES = new ParseProperties(); 11 | 12 | 13 | public static final String PARSE_APPLICATION_ID = PROPERTIES.getString("PARSE_APPLICATION_ID"); 14 | public static final String PARSE_CLIENT_KEY = PROPERTIES.getString("PARSE_CLIENT_KEY"); 15 | 16 | public static class ParseProperties { 17 | 18 | private final ResourceBundle mBundle = ResourceBundle.getBundle("parsepush"); 19 | 20 | public String getString(final String key) { 21 | return mBundle.getString(key); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /demo/src/main/java/com/bowyer/app/parsesendclient/demo/logic/ParseLogic.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo.logic; 2 | 3 | import com.bowyer.app.parsesendclient.demo.constant.EnvConst; 4 | import com.parse.Parse; 5 | import com.parse.ParseInstallation; 6 | 7 | import android.content.Context; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | 13 | /** 14 | * Created by Bowyer on 2015/08/01. 15 | */ 16 | public class ParseLogic { 17 | 18 | public static void ParseInit(Context context) { 19 | Parse.initialize(context, EnvConst.PARSE_APPLICATION_ID, 20 | EnvConst.PARSE_CLIENT_KEY); 21 | setChannel("demo"); 22 | } 23 | 24 | public static void setChannel(String channel) { 25 | ParseInstallation install = ParseInstallation.getCurrentInstallation(); 26 | List channels = new ArrayList<>(); 27 | channels.add(channel); 28 | install.put("channels", channels); 29 | install.saveInBackground(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /demo/src/main/java/com/bowyer/app/parsesendclient/demo/model/ParsePushModel.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.demo.model; 2 | 3 | /** 4 | * Created by Bowyer on 2015/08/02. 5 | */ 6 | public class ParsePushModel { 7 | 8 | String title; 9 | 10 | String message; 11 | 12 | String url; 13 | 14 | boolean forceSound; 15 | 16 | public static ParsePushModel to() { 17 | return new ParsePushModel(); 18 | } 19 | 20 | public ParsePushModel setTitle(String title) { 21 | this.title = title; 22 | return this; 23 | } 24 | 25 | public ParsePushModel setMessage(String message) { 26 | this.message = message; 27 | return this; 28 | } 29 | 30 | public ParsePushModel setUrl(String url) { 31 | this.url = url; 32 | return this; 33 | } 34 | 35 | public ParsePushModel setForceSound(boolean forceSound) { 36 | this.forceSound = forceSound; 37 | return this; 38 | } 39 | 40 | public String getTitle() { 41 | return title; 42 | } 43 | 44 | public String getMessage() { 45 | return message; 46 | } 47 | 48 | public String getUrl() { 49 | return url; 50 | } 51 | 52 | public boolean forceSound() { 53 | return forceSound; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 11 | 17 | 25 | 30 | 36 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 12 | 16 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/demo/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/demo/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/demo/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /demo/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /demo/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ParseSendClient ReceiveDemo 3 | 4 | This app is push notification receiver. If receive push notification,display message here. 5 | 6 | -------------------------------------------------------------------------------- /demo/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo/src/main/resources/parsepush.properties: -------------------------------------------------------------------------------- 1 | PARSE_APPLICATION_ID = CS8IDCVrhJLCdzMumjY7K63UjKkaW0R56XaDaEng 2 | PARSE_REST_API_KEY = n5yz1z4lZL9AcKHjGulQhByS3pBlphdrmYYSwq7Q 3 | PARSE_CLIENT_KEY = 8o2ohce0eRfJodWy5YsBbjT4CNHmjgtotlnAFnTa 4 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | VERSION_NAME=0.2.0 20 | VERSION_CODE=2 21 | COMPILE_SDK_VERSION=22 22 | BUILD_TOOLS_VERSION=22.0.1 23 | TARGET_SDK_VERSION=22 24 | MIN_SDK_VERSION=15 25 | 26 | GROUP=com.bowyer.app 27 | ARTIFACT_ID=parsesendclient 28 | ARTIFACT_NAME=ParseSendClient 29 | 30 | POM_DESCRIPTION=Parse push send client. 31 | POM_URL=https://github.com/bowyer-app/ParseSendClient 32 | POM_SCM_URL=https://github.com/bowyer-app/ParseSendClient.git 33 | POM_SCM_CONNECTION=https://github.com/bowyer-app/ParseSendClient.git 34 | POM_SCM_DEV_CONNECTION=https://github.com/bowyer-app/ParseSendClient.git 35 | POM_LICENCE_NAME=Released under the MIT license 36 | POM_LICENCE_URL=http://opensource.org/licenses/mit-license.php 37 | POM_LICENCE_DIST=repo 38 | POM_DEVELOPER_ID=bowyer-app 39 | POM_DEVELOPER_NAME=bowyer-app 40 | ISSUE_URL=https://github.com/bowyer-app/ParseSendClient/issues 41 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bowyer-app/ParseSendClient/5e41b2cdd1e7b4f57a5a7dd4f354507c7e4b0ac6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /parsesendclient/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /parsesendclient/bintray-publish.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven-publish' 2 | apply plugin: 'com.jfrog.bintray' 3 | 4 | task sourcesJar(type: Jar) { 5 | from android.sourceSets.main.java.srcDirs 6 | classifier = 'sources' 7 | } 8 | 9 | task javadoc(type: Javadoc) { 10 | source = android.sourceSets.main.java.srcDirs 11 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 12 | } 13 | 14 | task javadocJar(type: Jar, dependsOn: javadoc) { 15 | classifier = 'javadoc' 16 | from javadoc.destinationDir 17 | } 18 | 19 | artifacts { 20 | archives sourcesJar, javadocJar 21 | } 22 | 23 | def getBintrayUser() { 24 | return hasProperty('BINTRAY_USER') ? BINTRAY_USER : "" 25 | } 26 | 27 | def getBintrayApiKey() { 28 | return hasProperty('BINTRAY_APIKEY') ? BINTRAY_APIKEY : "" 29 | } 30 | 31 | def getGpgPassphrase() { 32 | return hasProperty('BINTRAY_GPG_PASSPHRASE') ? BINTRAY_GPG_PASSPHRASE : "" 33 | } 34 | 35 | publishing { 36 | publications { 37 | mavenJava(MavenPublication) { 38 | groupId GROUP 39 | version VERSION_NAME 40 | artifactId ARTIFACT_ID 41 | artifact "build/outputs/aar/parsesendclient-release.aar" 42 | artifact javadocJar 43 | artifact sourcesJar 44 | pom.withXml { 45 | Node root = asNode() 46 | root.appendNode('name', ARTIFACT_ID) 47 | root.appendNode('description', POM_DESCRIPTION) 48 | root.appendNode('url', POM_URL) 49 | 50 | def issues = root.appendNode('issueManagement') 51 | issues.appendNode('system', 'github') 52 | issues.appendNode('url', ISSUE_URL) 53 | 54 | def scm = root.appendNode('scm') 55 | scm.appendNode('url', POM_SCM_URL) 56 | scm.appendNode('connection', POM_SCM_CONNECTION) 57 | scm.appendNode('developerConnection', POM_SCM_DEV_CONNECTION) 58 | 59 | def license = root.appendNode('licenses').appendNode('license') 60 | license.appendNode('name', POM_LICENCE_NAME) 61 | license.appendNode('url', POM_LICENCE_URL) 62 | license.appendNode('distribution', POM_LICENCE_DIST) 63 | 64 | def dependenciesNode = asNode().appendNode('dependencies') 65 | configurations.compile.allDependencies.each { 66 | def dependencyNode = dependenciesNode.appendNode('dependency') 67 | dependencyNode.appendNode('groupId', it.group) 68 | dependencyNode.appendNode('artifactId', it.name) 69 | dependencyNode.appendNode('version', it.version) 70 | dependencyNode.appendNode('scope', 'compile') 71 | } 72 | } 73 | } 74 | } 75 | } 76 | 77 | bintray { 78 | user = bintrayUser 79 | key = bintrayApiKey 80 | 81 | publications = ['mavenJava'] 82 | 83 | dryRun = false 84 | publish = true 85 | 86 | pkg { 87 | repo = "maven" 88 | name = ARTIFACT_NAME 89 | desc = POM_DESCRIPTION 90 | websiteUrl = POM_URL 91 | issueTrackerUrl = ISSUE_URL 92 | vcsUrl = POM_SCM_URL 93 | licenses = ["Apache-2.0"] 94 | labels = ['android'] 95 | publicDownloadNumbers = true 96 | 97 | version { 98 | name = VERSION_NAME 99 | vcsTag = VERSION_NAME 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /parsesendclient/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion COMPILE_SDK_VERSION as int 5 | buildToolsVersion BUILD_TOOLS_VERSION 6 | 7 | defaultConfig { 8 | minSdkVersion MIN_SDK_VERSION 9 | targetSdkVersion TARGET_SDK_VERSION as int 10 | versionCode VERSION_CODE as int 11 | versionName VERSION_NAME 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.android.support:appcompat-v7:22.2.1' 23 | compile 'com.squareup.retrofit:retrofit:1.9.0' 24 | compile 'com.google.code.gson:gson:1.7.2' 25 | compile 'com.squareup.okhttp:okhttp:2.2.0' 26 | compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0' 27 | } 28 | 29 | apply from: 'bintray-publish.gradle' 30 | -------------------------------------------------------------------------------- /parsesendclient/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/a13089/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /parsesendclient/src/androidTest/java/com/bowyer/app/parsesendclient/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | 11 | public ApplicationTest() { 12 | super(Application.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /parsesendclient/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /parsesendclient/src/main/java/com/bowyer/app/parsesendclient/Api.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | import retrofit.Callback; 4 | import retrofit.http.Body; 5 | import retrofit.http.Headers; 6 | import retrofit.http.POST; 7 | 8 | /** 9 | * Created by Bowyer on 2015/08/02. 10 | */ 11 | public interface Api { 12 | 13 | class response { 14 | 15 | public String result; 16 | } 17 | 18 | @Headers({ 19 | "Content-Type: application/json" 20 | }) 21 | @POST("/1/push") 22 | void sendNotification(@Body ParsePushDto parsePushDto, Callback callback); 23 | } 24 | -------------------------------------------------------------------------------- /parsesendclient/src/main/java/com/bowyer/app/parsesendclient/ApiCreater.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | import com.squareup.okhttp.OkHttpClient; 4 | 5 | import retrofit.RequestInterceptor; 6 | import retrofit.RestAdapter; 7 | import retrofit.client.OkClient; 8 | 9 | /** 10 | * Created by Bowyer on 2015/08/02. 11 | */ 12 | public class ApiCreater { 13 | 14 | private static final String PARSE_APPLICATION_ID = "X-Parse-Application-Id"; 15 | private static final String PARSE_REST_API_KEY = "X-Parse-REST-API-Key"; 16 | private static final String serverUrl = "https://api.parse.com"; 17 | public static Api sharedInstance; 18 | 19 | public static synchronized Api getInstance() { 20 | if (sharedInstance != null) { 21 | return sharedInstance; 22 | } 23 | 24 | RequestInterceptor requestInterceptor = new RequestInterceptor() { 25 | @Override 26 | public void intercept(RequestFacade request) { 27 | request.addHeader(PARSE_APPLICATION_ID, EnvConst.PARSE_APPLICATION_ID); 28 | request.addHeader(PARSE_REST_API_KEY, EnvConst.PARSE_REST_API_KEY); 29 | } 30 | }; 31 | RestAdapter.Builder builder = new RestAdapter.Builder() 32 | .setEndpoint(serverUrl) 33 | .setRequestInterceptor(requestInterceptor) 34 | .setClient(new OkClient(new OkHttpClient())); 35 | 36 | if (BuildConfig.DEBUG) { 37 | builder.setLogLevel(RestAdapter.LogLevel.FULL).setLog(new BetterLog("RETROFIT")); 38 | } 39 | 40 | return sharedInstance = builder.build().create(Api.class); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /parsesendclient/src/main/java/com/bowyer/app/parsesendclient/BetterLog.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | import android.util.Log; 4 | 5 | import retrofit.RestAdapter; 6 | 7 | public class BetterLog implements RestAdapter.Log { 8 | 9 | private static final int LOG_CHUNK_SIZE = 4000; 10 | 11 | private final String tag; 12 | 13 | public BetterLog(String tag) { 14 | this.tag = tag; 15 | } 16 | 17 | @Override 18 | public final void log(String message) { 19 | int index = message.indexOf("Content-Transfer-Encoding: binary"); 20 | if (index != -1) { // ignore binary multipart body. 21 | logChunk(message.substring(0, index + "Content-Transfer-Encoding: binary".length()) 22 | + " <<< binary data >>>"); 23 | return; 24 | } 25 | 26 | for (int i = 0, len = message.length(); i < len; i += LOG_CHUNK_SIZE) { 27 | int end = Math.min(len, i + LOG_CHUNK_SIZE); 28 | logChunk(message.substring(i, end)); 29 | } 30 | } 31 | 32 | /** 33 | * Called one or more times for each call to {@link #log(String)}. The length of {@code chunk} 34 | * will be no more than 4000 characters to support Android's {@link Log} class. 35 | */ 36 | public void logChunk(String chunk) { 37 | Log.d(getTag(), chunk); 38 | } 39 | 40 | public String getTag() { 41 | return tag; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /parsesendclient/src/main/java/com/bowyer/app/parsesendclient/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | import java.text.DateFormat; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Calendar; 6 | import java.util.TimeZone; 7 | 8 | /** 9 | * Created by Bowyer on 2015/08/03. 10 | */ 11 | public class DateUtil { 12 | 13 | public static String getUtcTime(Calendar calendar) { 14 | TimeZone tz = TimeZone.getTimeZone("UTC"); 15 | DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); 16 | df.setTimeZone(tz); 17 | return df.format(calendar.getTime()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /parsesendclient/src/main/java/com/bowyer/app/parsesendclient/EnvConst.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | /** 6 | * Created by Bowyer on 2015/08/02. 7 | */ 8 | public class EnvConst { 9 | 10 | public static final ParseProperties PROPERTIES = new ParseProperties(); 11 | 12 | 13 | public static final String PARSE_APPLICATION_ID = PROPERTIES.getString("PARSE_APPLICATION_ID"); 14 | public static final String PARSE_REST_API_KEY = PROPERTIES.getString("PARSE_REST_API_KEY"); 15 | 16 | public static class ParseProperties { 17 | 18 | private final ResourceBundle mBundle = ResourceBundle.getBundle("parsepush"); 19 | 20 | public String getString(final String key) { 21 | return mBundle.getString(key); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /parsesendclient/src/main/java/com/bowyer/app/parsesendclient/ParsePushDto.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | /** 4 | * Created by Bowyer on 2015/08/02. 5 | */ 6 | public class ParsePushDto { 7 | 8 | public Object data; 9 | public String[] channels; 10 | public String push_time; 11 | 12 | public ParsePushDto setParsePushModel(Object model) { 13 | this.data = model; 14 | return this; 15 | } 16 | 17 | public ParsePushDto setChannels(String[] channels) { 18 | this.channels = channels; 19 | return this; 20 | } 21 | 22 | public ParsePushDto setPushTime(String pushTime) { 23 | this.push_time = pushTime; 24 | return this; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /parsesendclient/src/main/java/com/bowyer/app/parsesendclient/PushSendLogic.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient; 2 | 3 | import android.util.Log; 4 | 5 | import java.util.Calendar; 6 | 7 | import retrofit.Callback; 8 | import retrofit.RetrofitError; 9 | import retrofit.client.Response; 10 | 11 | /** 12 | * Created by Bowyer on 2015/08/02. 13 | */ 14 | public class PushSendLogic { 15 | 16 | public static final String TAG = PushSendLogic.class.getSimpleName(); 17 | 18 | public interface PushSendCallBack { 19 | 20 | void onSuccess(); 21 | 22 | void onFailure(String message); 23 | } 24 | 25 | private static PushSendCallBack mPushSendCallBack; 26 | 27 | public static void sendPush(Object model, String[] channels, PushSendCallBack callBack) { 28 | 29 | mPushSendCallBack = callBack; 30 | ParsePushDto dto = new ParsePushDto().setParsePushModel(model).setChannels(channels); 31 | send(dto); 32 | } 33 | 34 | public static void sendSchedulingPush(Object model, Calendar calendar, String[] channels, 35 | PushSendCallBack callBack) { 36 | 37 | mPushSendCallBack = callBack; 38 | ParsePushDto dto = new ParsePushDto().setParsePushModel(model).setChannels(channels) 39 | .setPushTime(DateUtil.getUtcTime(calendar)); 40 | send(dto); 41 | } 42 | 43 | public static void send(ParsePushDto dto) { 44 | Api api = ApiCreater.getInstance(); 45 | api.sendNotification(dto, new Callback() { 46 | @Override 47 | public void success(Api.response response, Response response2) { 48 | 49 | if (BuildConfig.DEBUG) { 50 | Log.d(TAG, response2.getBody().toString()); 51 | } 52 | 53 | if (mPushSendCallBack != null) { 54 | mPushSendCallBack.onSuccess(); 55 | } 56 | 57 | } 58 | 59 | @Override 60 | public void failure(RetrofitError error) { 61 | 62 | if (BuildConfig.DEBUG) { 63 | Log.d(TAG, error.getMessage()); 64 | } 65 | 66 | if (mPushSendCallBack != null) { 67 | mPushSendCallBack.onFailure(error.getMessage()); 68 | } 69 | 70 | } 71 | }); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /parsesendclient/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | library 3 | 4 | -------------------------------------------------------------------------------- /senddemo/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /senddemo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion COMPILE_SDK_VERSION as int 5 | buildToolsVersion BUILD_TOOLS_VERSION 6 | 7 | defaultConfig { 8 | applicationId "com.bowyer.app.parsesendclient.senddemo" 9 | minSdkVersion MIN_SDK_VERSION 10 | targetSdkVersion TARGET_SDK_VERSION as int 11 | versionCode VERSION_CODE as int 12 | versionName VERSION_NAME 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | compile project(':parsesendclient') 25 | //ui 26 | compile 'com.jakewharton:butterknife:6.1.0' 27 | compile 'com.android.support:appcompat-v7:22.2.1' 28 | compile 'com.github.citux:datetimepicker:0.1.2' 29 | compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4' 30 | compile 'com.github.rey5137:material:1.2.1' 31 | } 32 | -------------------------------------------------------------------------------- /senddemo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/a13089/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /senddemo/src/androidTest/java/com/bowyer/app/parsesendclient/senddemo/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.senddemo; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | 11 | public ApplicationTest() { 12 | super(Application.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /senddemo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /senddemo/src/main/java/com/bowyer/app/parsesendclient/senddemo/PushSendActivity.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.senddemo; 2 | 3 | import com.android.datetimepicker.date.DatePickerDialog; 4 | import com.android.datetimepicker.time.RadialPickerLayout; 5 | import com.android.datetimepicker.time.TimePickerDialog; 6 | import com.bowyer.app.parsesendclient.PushSendLogic; 7 | import com.bowyer.app.parsesendclient.senddemo.model.ParsePushModel; 8 | import com.dd.processbutton.iml.ActionProcessButton; 9 | import com.rey.material.widget.Switch; 10 | 11 | import android.os.Bundle; 12 | import android.support.v7.app.ActionBarActivity; 13 | import android.text.TextUtils; 14 | import android.webkit.URLUtil; 15 | import android.widget.Button; 16 | import android.widget.EditText; 17 | import android.widget.Toast; 18 | 19 | import java.text.DateFormat; 20 | import java.text.SimpleDateFormat; 21 | import java.util.Calendar; 22 | import java.util.Locale; 23 | 24 | import butterknife.ButterKnife; 25 | import butterknife.InjectView; 26 | import butterknife.OnClick; 27 | 28 | 29 | public class PushSendActivity extends ActionBarActivity 30 | implements DatePickerDialog.OnDateSetListener, TimePickerDialog.OnTimeSetListener { 31 | 32 | private static final String TIME_PATTERN = "HH:mm:ss"; 33 | 34 | @InjectView(R.id.push_title) 35 | EditText mPushTitle; 36 | 37 | @InjectView(R.id.push_message) 38 | EditText mPushMessage; 39 | 40 | @InjectView(R.id.push_url) 41 | EditText mPushUrl; 42 | 43 | @InjectView(R.id.date) 44 | Button mDate; 45 | 46 | @InjectView(R.id.time) 47 | Button mTime; 48 | 49 | @InjectView(R.id.send_push_now) 50 | ActionProcessButton mSendPushNow; 51 | 52 | @InjectView(R.id.send_scheduling_push) 53 | ActionProcessButton mSendSchedulingPush; 54 | 55 | @InjectView(R.id.notification_switch) 56 | Switch mSwitch; 57 | 58 | private DateFormat dateFormat; 59 | 60 | private SimpleDateFormat timeFormat; 61 | 62 | private Calendar calendar; 63 | 64 | private final String DEF_PUSH_TITLE = "PushSendClient"; 65 | 66 | private final String DEF_PUSH_MESSAGE = "Push send Test Message"; 67 | 68 | @Override 69 | protected void onCreate(Bundle savedInstanceState) { 70 | super.onCreate(savedInstanceState); 71 | setContentView(R.layout.activity_push_send); 72 | ButterKnife.inject(this); 73 | 74 | calendar = Calendar.getInstance(); 75 | dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.getDefault()); 76 | timeFormat = new SimpleDateFormat(TIME_PATTERN, Locale.getDefault()); 77 | update(); 78 | } 79 | 80 | @OnClick(R.id.date) 81 | void onClickDate() { 82 | DatePickerDialog 83 | .newInstance(this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 84 | calendar.get(Calendar.DAY_OF_MONTH)).show( 85 | getFragmentManager(), "datePicker"); 86 | } 87 | 88 | @OnClick(R.id.time) 89 | void onClickTime() { 90 | TimePickerDialog.newInstance(this, calendar.get(Calendar.HOUR_OF_DAY), 91 | calendar.get(Calendar.MINUTE), true).show(getFragmentManager(), "timePicker"); 92 | } 93 | 94 | @OnClick(R.id.send_push_now) 95 | void sendPushNow() { 96 | ParsePushModel model = getPushData(); 97 | if (!validatePushData(model)) { 98 | return; 99 | } 100 | 101 | mSendPushNow.setProgress(50); 102 | String[] channel = new String[1]; 103 | channel[0] = "demo"; 104 | 105 | PushSendLogic.sendPush(model, channel, 106 | new PushSendLogic.PushSendCallBack() { 107 | @Override 108 | public void onSuccess() { 109 | mSendPushNow.setProgress(100); 110 | } 111 | 112 | @Override 113 | public void onFailure(String message) { 114 | mSendPushNow.setProgress(-1); 115 | } 116 | }); 117 | } 118 | 119 | @OnClick(R.id.send_scheduling_push) 120 | void sendPush() { 121 | 122 | ParsePushModel model = getPushData(); 123 | if (!validatePushData(model)) { 124 | return; 125 | } 126 | 127 | mSendSchedulingPush.setProgress(50); 128 | 129 | String[] channel = new String[1]; 130 | channel[0] = "demo"; 131 | 132 | PushSendLogic.sendSchedulingPush(model, calendar, channel, 133 | new PushSendLogic.PushSendCallBack() { 134 | @Override 135 | public void onSuccess() { 136 | mSendSchedulingPush.setProgress(100); 137 | } 138 | 139 | @Override 140 | public void onFailure(String message) { 141 | mSendSchedulingPush.setProgress(-1); 142 | } 143 | }); 144 | } 145 | 146 | private boolean validatePushData(ParsePushModel model) { 147 | if (model == null) { 148 | Toast.makeText(this, "Invalid Url.", Toast.LENGTH_SHORT).show(); 149 | return false; 150 | } 151 | return true; 152 | } 153 | 154 | private ParsePushModel getPushData() { 155 | String title = mPushTitle.getText().toString(); 156 | String message = mPushMessage.getText().toString(); 157 | String url = mPushUrl.getText().toString(); 158 | boolean forceSound = mSwitch.isChecked(); 159 | 160 | if (!TextUtils.isEmpty(url) && !URLUtil.isValidUrl(url)) { 161 | return null; 162 | } 163 | 164 | String pushTitle = TextUtils.isEmpty(title) ? DEF_PUSH_TITLE : title; 165 | String pushMessage = TextUtils.isEmpty(message) ? DEF_PUSH_MESSAGE : message; 166 | String pushUrl = TextUtils.isEmpty(url) ? null : url; 167 | 168 | return ParsePushModel.to().setTitle(pushTitle).setMessage( 169 | pushMessage).setUrl(pushUrl).setForceSound(forceSound); 170 | } 171 | 172 | private void update() { 173 | mDate.setText(dateFormat.format(calendar.getTime())); 174 | mTime.setText(timeFormat.format(calendar.getTime())); 175 | } 176 | 177 | @Override 178 | public void onDateSet(DatePickerDialog dialog, int year, int monthOfYear, int dayOfMonth) { 179 | calendar.set(year, monthOfYear, dayOfMonth); 180 | update(); 181 | } 182 | 183 | @Override 184 | public void onTimeSet(RadialPickerLayout view, int hourOfDay, int minute) { 185 | calendar.set(Calendar.HOUR_OF_DAY, hourOfDay); 186 | calendar.set(Calendar.MINUTE, minute); 187 | update(); 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /senddemo/src/main/java/com/bowyer/app/parsesendclient/senddemo/model/ParsePushModel.java: -------------------------------------------------------------------------------- 1 | package com.bowyer.app.parsesendclient.senddemo.model; 2 | 3 | /** 4 | * Created by Bowyer on 2015/08/02. 5 | */ 6 | public class ParsePushModel { 7 | 8 | String title; 9 | 10 | String message; 11 | 12 | String url; 13 | 14 | boolean forceSound; 15 | 16 | public static ParsePushModel to() { 17 | return new ParsePushModel(); 18 | } 19 | 20 | public ParsePushModel setTitle(String title) { 21 | this.title = title; 22 | return this; 23 | } 24 | 25 | public ParsePushModel setMessage(String message) { 26 | this.message = message; 27 | return this; 28 | } 29 | 30 | public ParsePushModel setUrl(String url) { 31 | this.url = url; 32 | return this; 33 | } 34 | 35 | public ParsePushModel setForceSound(boolean forceSound) { 36 | this.forceSound = forceSound; 37 | return this; 38 | } 39 | 40 | public String getTitle() { 41 | return title; 42 | } 43 | 44 | public String getMessage() { 45 | return message; 46 | } 47 | 48 | public String getUrl() { 49 | return url; 50 | } 51 | 52 | public boolean forceSound() { 53 | return forceSound; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /senddemo/src/main/res/layout/activity_push_send.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | 20 | 29 | 30 | 39 | 40 | 45 | 46 | 52 | 53 | 64 | 65 | 66 |