Skip to content

Instantly share code, notes, and snippets.

View kariot's full-sized avatar
🚴‍♂️
Focusing

Sreehari K kariot

🚴‍♂️
Focusing
View GitHub Profile
@kariot
kariot / MyFirebaseMessagingService.kt
Created April 19, 2021 12:10
Creates Notification from FCM Service With Image
private fun showNotification(remoteMessage: RemoteMessage) {
val intent = Intent(this, SplashActivity::class.java)
val pendingIntent = PendingIntent.getActivity(this, 123, intent, PendingIntent.FLAG_ONE_SHOT)
val channelId = getString(R.string.default_notification_channel_id)
val defaultSoundUri: Uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
val notificationBuilder: NotificationCompat.Builder =
NotificationCompat.Builder(this, channelId)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle(remoteMessage.notification!!.title)
.setContentText(remoteMessage.notification!!.body)
@kariot
kariot / Gateway3DSecureActivity.kt
Last active October 12, 2020 09:57
MasterCard Gateway Android SDK 3DS Secure Auth in Kotlin
public class GatewaySecureActivity : AppCompatActivity() {
companion object{
/**
* The HTML used to initialize the WebView. Should be the HTML content returned from the Gateway
* during the Check 3DS Enrollment call
*/
val EXTRA_HTML = "com.mastercard.gateway.android.HTML"
/**