|
@@ -19,6 +19,8 @@ import android.annotation.SuppressLint;
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
import android.app.ActivityManager;
|
|
import android.app.ActivityManager;
|
|
import android.app.Dialog;
|
|
import android.app.Dialog;
|
|
|
|
+import android.app.NotificationChannel;
|
|
|
|
+import android.app.NotificationManager;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.content.SharedPreferences;
|
|
import android.content.SharedPreferences;
|
|
@@ -137,6 +139,7 @@ import org.telegram.messenger.browser.Browser;
|
|
import org.telegram.messenger.voip.VideoCapturerDevice;
|
|
import org.telegram.messenger.voip.VideoCapturerDevice;
|
|
import org.telegram.messenger.voip.VoIPPendingCall;
|
|
import org.telegram.messenger.voip.VoIPPendingCall;
|
|
import org.telegram.messenger.voip.VoIPService;
|
|
import org.telegram.messenger.voip.VoIPService;
|
|
|
|
+import org.telegram.onecric.ui.activity.CricketDetailActivity;
|
|
import org.telegram.onecric.ui.activity.MatchActivity;
|
|
import org.telegram.onecric.ui.activity.MatchActivity;
|
|
import org.telegram.tgnet.ConnectionsManager;
|
|
import org.telegram.tgnet.ConnectionsManager;
|
|
import org.telegram.tgnet.TLObject;
|
|
import org.telegram.tgnet.TLObject;
|
|
@@ -1544,6 +1547,41 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private void handleNotification(Intent pintent) {
|
|
|
|
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
|
|
+// // Create channel to show notifications.
|
|
|
|
+// String channelId = getString(R.string.default_notification_channel_id);
|
|
|
|
+// String channelName = getString(R.string.default_notification_channel_name);
|
|
|
|
+// NotificationManager notificationManager =
|
|
|
|
+// getSystemService(NotificationManager.class);
|
|
|
|
+// notificationManager.createNotificationChannel(new NotificationChannel(channelId,
|
|
|
|
+// channelName, NotificationManager.IMPORTANCE_LOW));
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ // If a notification message is tapped, any data accompanying the notification
|
|
|
|
+ // message is available in the intent extras. In this sample the launcher
|
|
|
|
+ // intent is fired when the notification is tapped, so any accompanying data would
|
|
|
|
+ // be handled here. If you want a different intent fired, set the click_action
|
|
|
|
+ // field of the notification message to the desired intent. The launcher intent
|
|
|
|
+ // is used when no click_action is specified.
|
|
|
|
+ //
|
|
|
|
+ // Handle possible data accompanying notification message.
|
|
|
|
+ // [START handle_data_extras]
|
|
|
|
+ if (pintent.getExtras() != null) {
|
|
|
|
+// for (String key : getIntent().getExtras().keySet()) {
|
|
|
|
+// Object value = getIntent().getExtras().get(key);
|
|
|
|
+// Log.d(TAG, "Key: " + key + " Value: " + value);
|
|
|
|
+// }
|
|
|
|
+ Intent intent = new Intent();
|
|
|
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
+ Bundle bundle = pintent.getExtras();
|
|
|
|
+ intent.setClass(this, CricketDetailActivity.class);
|
|
|
|
+ intent.putExtra("matchId", Integer.parseInt(bundle.getString("matchId")));
|
|
|
|
+ startActivity(intent);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@SuppressLint("Range")
|
|
@SuppressLint("Range")
|
|
private boolean handleIntent(Intent intent, boolean isNew, boolean restore, boolean fromPassword) {
|
|
private boolean handleIntent(Intent intent, boolean isNew, boolean restore, boolean fromPassword) {
|
|
if (AndroidUtilities.handleProxyIntent(this, intent)) {
|
|
if (AndroidUtilities.handleProxyIntent(this, intent)) {
|
|
@@ -4660,6 +4698,9 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
|
|
public void onNewIntent(Intent intent) {
|
|
public void onNewIntent(Intent intent) {
|
|
super.onNewIntent(intent);
|
|
super.onNewIntent(intent);
|
|
handleIntent(intent, true, false, false);
|
|
handleIntent(intent, true, false, false);
|
|
|
|
+ if (intent.getExtras() != null) {
|
|
|
|
+ handleNotification(intent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|