dkrivoruchko / ScreenStream

ScreenStream Android App
https://screenstream.io
MIT License
1.7k stars 337 forks source link

StartStreamOnBoot #127

Closed pewpewar closed 3 years ago

pewpewar commented 3 years ago

Hi! im trying to edit your BootReceiver to implement StartStream,over StartOnBoot, on boot. (IntentAction.StartStream.sendToAppService(context)) but this doesn't work, have u any tips? Thanks

dkrivoruchko commented 3 years ago

You cannot start stream without asking for Cast permission. To ask Cast permission you need Activity context. So you need user to start activity manually.

SergeyStorm commented 3 years ago

I managed to permanently allow casting for this application without asking for user permission. But anyway I need to bring the application to foreground for streaming to start. Is there any way to solve this?

dkrivoruchko commented 3 years ago

You cannot allow casting without asking user permission. On Android 5-9 user can check option "Do not ask again". On Android 10+ there is no more such option. In any case you need an activity in foreground to request permission. And again, on Android up to 9 you can start activity programmatically from foreground (and ask for permission), on Android 10+ it's not allowed any more (user must manually open Activity).

SergeyStorm commented 3 years ago

You cannot allow casting without asking user permission.

But I did it, using App Ops and Shizuki. The app no longer asks for permission, the dialogue doesn't appear.

And again, on Android up to 9 you can start activity programmatically from foreground (and ask for permission)

Is it possible to do that, for example, from termux and without user interaction?

dkrivoruchko commented 3 years ago

Well you need rooted device... This is not an option for this app.