update
- By vodkasalad
- VIP Lounge
- 6 Replies
I have tried everything I can think of and still cannot get 9.0 update on my unlocked s9 help please thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
// if (remoteMessage.notification !=null) {
// showNotification(remoteMessage.notification?.title, remoteMessage.notification?.body)
// }
}
fun showNotification(title: String?, body: String?, context: Context) {
val intent = Intent(context, SearchActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
}
val pendingIntent = PendingIntent.getActivity(context, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT)
val soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
val notificationBuilder = NotificationCompat.Builder(context, "my_channel_id_01").apply {
setSmallIcon(R.drawable.my_friends_room_logo)
setContentTitle(title)
setContentText(body)
setSound(soundUri)
setDefaults(DEFAULT_ALL)
setTimeoutAfter(2000)
setPriority(PRIORITY_HIGH)
setVibrate(LongArray(0))
}
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.notify(0, notificationBuilder.build())
}
class FirebaseBackgroundService : BroadcastReceiver() {
var myFirebaseMessagingService = MyFirebaseMessagingService()
var notificationtitle: Any? = ""
var notificationbody: Any? = ""
override fun onReceive(context: Context, intent: Intent) {
if (intent.extras != null) {
for (key in intent.extras!!.keySet()) {
val value = intent.extras!!.get(key)
Log.e("FirebaseDataReceiver", "Key: $key Value: $value")
if (key.equals("gcm.notification.title", ignoreCase = true) && value != null) {
notificationtitle = value
}
if (key.equals("gcm.notification.body", ignoreCase = true) && value != null) {
notificationbody = value
}
}
myFirebaseMessagingService.showNotification(notificationtitle as String, notificationbody as String, context)
}
}
}
{
"to" : "some-id",
"priority":"high",
"notification" : {
"body" : "Body of Your Notification",
"title": "Title of Your Notification",
"content_available" : true,
"sound": "sound1.mp3",
"click_action" : "chat"
},
"data": {
"uid" : "yOMX4OagvgXEl4w4l78F7SlqzKr2",
"method" : "chat",
"android_channel_id": "1"
}
}
public String SolicitudServidor(final Activity activity, final String Type, final String Name, final String Surname, final String Username, final String Password){
String URL, Response;
if(Type.equals("Register")){
URL="http://web-androidapp.000webhostapp.com/androidapp/registerUser.php?name="+Name.replaceAll(" ", "%20")+"&surname="+Surname.replaceAll(" ", "%20")+"&username="+Username+"&password="+Password;
}else if(Type.equals("Check")){
URL="http://web-androidapp.000webhostapp.com/androidapp/CheckUser.php?username="+Username;
}
StringRequest stringRequest=new StringRequest(Request.Method.POST, URL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try{
JSONObject jsonObject=new JSONObject(response);
Response=jsonObject.getString("Ok");
}catch (JSONException e){
e.printStackTrace();
MostrarPopUp("Error", activity);
}
}
},
new Response.ErrorListener(){
@Override
public void onErrorResponse(VolleyError error){
MostrarPopUp("Error", activity);
}
});
RequestQueue requestQueue= Volley.newRequestQueue(activity);
requestQueue.add(stringRequest);
return Response;
}
