Created
February 1, 2020 14:01
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search
Settings
fornotification access
and enable the listener service: