Vitalik
3 years ago
7 changed files with 135 additions and 116 deletions
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
{ |
||||
"agcgw":{ |
||||
"backurl":"connect-dre.hispace.hicloud.com", |
||||
"url":"connect-dre.dbankcloud.cn", |
||||
"websocketbackurl":"connect-ws-dre.hispace.dbankcloud.com", |
||||
"websocketurl":"connect-ws-dre.hispace.dbankcloud.cn" |
||||
}, |
||||
"agcgw_all":{ |
||||
"CN":"connect-drcn.dbankcloud.cn", |
||||
"CN_back":"connect-drcn.hispace.hicloud.com", |
||||
"DE":"connect-dre.dbankcloud.cn", |
||||
"DE_back":"connect-dre.hispace.hicloud.com", |
||||
"RU":"connect-drru.dbankcloud.cn", |
||||
"RU_back":"connect-drru.hispace.hicloud.com", |
||||
"SG":"connect-dra.dbankcloud.cn", |
||||
"SG_back":"connect-dra.hispace.hicloud.com" |
||||
}, |
||||
"client":{ |
||||
"cp_id":"5190380000022214767", |
||||
"product_id":"99536292102144353", |
||||
"client_id":"862382646548773760", |
||||
"client_secret":"8EA7649C003DD64B5C46A786AB5FAAAB3D0605685780DB67C900635EFD64F498", |
||||
"project_id":"99536292102144353", |
||||
"app_id":"105896531", |
||||
"api_key":"DAEDAMe2g0hAuXPDcOWX/VjzI9nScUzYz9mqg91UlGpseX11V5bNprMJPD5dVXxZOvZ5uThxc8vSZlkf3ki4nzMZ46mB/ek7pYdPcA==", |
||||
"package_name":"com.taskme2" |
||||
}, |
||||
"oauth_client":{ |
||||
"client_id":"105896531", |
||||
"client_type":1 |
||||
}, |
||||
"app_info":{ |
||||
"app_id":"105896531", |
||||
"package_name":"com.taskme2" |
||||
}, |
||||
"service":{ |
||||
"analytics":{ |
||||
"collector_url":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn", |
||||
"collector_url_ru":"datacollector-drru.dt.hicloud.com,datacollector-drru.dt.dbankcloud.cn", |
||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn", |
||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn", |
||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn", |
||||
"resource_id":"p1", |
||||
"channel_id":"" |
||||
}, |
||||
"search":{ |
||||
"url":"https://search-dre.cloud.huawei.com" |
||||
}, |
||||
"cloudstorage":{ |
||||
"storage_url":"https://ops-dre.agcstorage.link" |
||||
}, |
||||
"ml":{ |
||||
"mlservice_url":"ml-api-dre.ai.dbankcloud.com,ml-api-dre.ai.dbankcloud.cn" |
||||
} |
||||
}, |
||||
"region":"DE", |
||||
"configuration_version":"3.0", |
||||
"appInfos":[ |
||||
{ |
||||
"package_name":"com.taskme2", |
||||
"client":{ |
||||
"app_id":"105896531" |
||||
}, |
||||
"app_info":{ |
||||
"package_name":"com.taskme2", |
||||
"app_id":"105896531" |
||||
}, |
||||
"oauth_client":{ |
||||
"client_type":1, |
||||
"client_id":"105896531" |
||||
} |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
package com.taskme; |
||||
|
||||
import android.content.Context; |
||||
import android.util.Log; |
||||
import org.json.JSONObject; |
||||
|
||||
import com.onesignal.OSNotification; |
||||
import com.onesignal.OSMutableNotification; |
||||
import com.onesignal.OSNotificationReceivedEvent; |
||||
import com.onesignal.OneSignal.OSRemoteNotificationReceivedHandler; |
||||
|
||||
@SuppressWarnings("unused") |
||||
public class NotificationServiceExtension implements OSRemoteNotificationReceivedHandler { |
||||
|
||||
@Override |
||||
public void remoteNotificationReceived(Context context, OSNotificationReceivedEvent notificationReceivedEvent) { |
||||
OSNotification notification = notificationReceivedEvent.getNotification(); |
||||
|
||||
// Example of modifying the notification's accent color
|
||||
OSMutableNotification mutableNotification = notification.mutableCopy(); |
||||
mutableNotification.setExtender(builder -> { |
||||
// Sets the accent color to Green on Android 5+ devices.
|
||||
// // Accent color controls icon and action buttons on Android 5+. Accent color does not change app title on Android 10+
|
||||
// builder.setColor(new BigInteger("FF00FF00", 16).intValue());
|
||||
// // Sets the notification Title to Red
|
||||
// Spannable spannableTitle = new SpannableString(notification.getTitle());
|
||||
// spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
|
||||
// builder.setContentTitle(spannableTitle);
|
||||
// // Sets the notification Body to Blue
|
||||
// Spannable spannableBody = new SpannableString(notification.getBody());
|
||||
// spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
|
||||
// builder.setContentText(spannableBody);
|
||||
// //Force remove push from Notification Center after 30 seconds
|
||||
builder.setTimeoutAfter(30000); |
||||
return builder; |
||||
}); |
||||
JSONObject data = notification.getAdditionalData(); |
||||
Log.i("OneSignalExample", "Received Notification Data: " + data); |
||||
|
||||
// If complete isn't call within a time period of 25 seconds, OneSignal internal logic will show the original notification
|
||||
// To omit displaying a notification, pass `null` to complete()
|
||||
notificationReceivedEvent.complete(mutableNotification); |
||||
} |
||||
} |
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
|
Loading…
Reference in new issue