bernaferrari / ChangeDetection

Automatically track websites changes on Android in background.
Apache License 2.0
703 stars 98 forks source link

Allow "Open in Browser" from Notification #51

Open newhinton opened 1 year ago

newhinton commented 1 year ago

It would be nice if change-notifications would have an action that opens the changed site in a browser.

Currently one has to open the app, wait for it to redraw, find the changed item, open that item and only then open it in the browser. It would be nice to have a shortcut.

Thanks!

newhinton commented 1 year ago

I assume adding

            .actions {
                add(
                    NotificationCompat.Action(
                    R.drawable.ic_open_browser,
                    context.getString(R.string.open_in_browser),
                    PendingIntent.getService(context,
                        0,
                        Intent(Intent.ACTION_VIEW).setData(Uri.parse(newSite.url)),
                        0)
                ))
            }

to OneTimeSync.kt:L164 will add this. Though i cant get the app to build with android studio, are there any special reqirements?