Untitled
unknown
plain_text
2 years ago
1.6 kB
20
Indexable
import io.flutter.embedding.android.FlutterActivity
import android.os.Bundle
import android.util.Log
import com.netcore.smartech_base.SmartechDeeplinkReceivers
import com.netcore.android.smartechpush.SmartPush
import com.netcore.android.smartechpush.notification.SMTNotificationOptions
import com.netcore.android.smartechpush.notification.channel.SMTNotificationChannel
import com.netcore.android.Smartech
import android.app.NotificationManager
import java.lang.ref.WeakReference
class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
SmartechDeeplinkReceivers().onReceive(this, intent)
Log.d("MainActivity", "MainActivity open2")
SmartPush.getInstance(WeakReference(this)).createNotificationChannelGroup("customSoundGroup", "testgroup")
val smtBuilder: SMTNotificationChannel.Builder= SMTNotificationChannel.Builder(
"1234",
"CustSound",
NotificationManager.IMPORTANCE_HIGH)
smtBuilder.setChannelDescription("thisischanneldesc")
//To set the description to the channel add below method.
smtBuilder.setChannelGroupId("customSoundGroup")
//To set sound to channel, add below method. (Note that sound name must be without extention.)
smtBuilder.setNotificationSound("lau")
val smtNotificationChannel: SMTNotificationChannel = smtBuilder.build()
SmartPush.getInstance(WeakReference(this)).createNotificationChannel(smtNotificationChannel)
}
}
Editor is loading...
Leave a Comment