Skip to content

Instantly share code, notes, and snippets.

@emmaguy
Created February 1, 2020 14:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmaguy/051364d43d2d877ba7bd5da772019b37 to your computer and use it in GitHub Desktop.
Save emmaguy/051364d43d2d877ba7bd5da772019b37 to your computer and use it in GitHub Desktop.
Click the 'Skip Intro' button on the Android notification from the Netflix app
<service
android:name=".NotificationService"
android:label="@string/notification_service_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
class NotificationService : NotificationListenerService() {
override fun onNotificationPosted(sbn: StatusBarNotification) {
if (sbn.packageName.contains("netflix")) {
val skipIntroAction = sbn.notification.actions
.find { it.title.contains("Skip Intro", ignoreCase = true) }
skipIntroAction?.actionIntent?.send()
}
super.onNotificationPosted(sbn)
}
}
@emmaguy
Copy link
Author

emmaguy commented Feb 1, 2020

Search Settings for notification access and enable the listener service:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment