{"id":13786993,"url":"https://github.com/judemanutd/AutoStarter","last_synced_at":"2025-05-12T00:30:38.462Z","repository":{"id":32788615,"uuid":"123686428","full_name":"judemanutd/AutoStarter","owner":"judemanutd","description":"This library helps bring up the autostart permission manager of a phone to the user so they can add an app to autostart.","archived":false,"fork":false,"pushed_at":"2021-07-10T18:41:37.000Z","size":245,"stargazers_count":626,"open_issues_count":28,"forks_count":115,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-11-18T00:37:17.523Z","etag":null,"topics":["android","android-library","autostart","hacktoberfest","hacktoberfest2022","java","permission-android","permission-manager"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/judemanutd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-03T11:37:48.000Z","updated_at":"2024-11-14T02:21:39.000Z","dependencies_parsed_at":"2022-07-16T07:46:54.098Z","dependency_job_id":null,"html_url":"https://github.com/judemanutd/AutoStarter","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judemanutd%2FAutoStarter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judemanutd%2FAutoStarter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judemanutd%2FAutoStarter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judemanutd%2FAutoStarter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/judemanutd","download_url":"https://codeload.github.com/judemanutd/AutoStarter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253655755,"owners_count":21943068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","autostart","hacktoberfest","hacktoberfest2022","java","permission-android","permission-manager"],"created_at":"2024-08-03T20:00:24.320Z","updated_at":"2025-05-12T00:30:37.695Z","avatar_url":"https://github.com/judemanutd.png","language":"Kotlin","funding_links":[],"categories":["Library"],"sub_categories":[],"readme":"# Autostarter\n\n[![](https://jitpack.io/v/judemanutd/AutoStarter.svg)](https://jitpack.io/#judemanutd/AutoStarter)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://opensource.org/licenses/MIT) \n[![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)\n\n\u003cimg src=\"Logotype primary.png\" width=\"70%\" height=\"70%\" /\u003e\n\nThis library helps bring up the autostart permission manager of a phone to the user so they can add\nan app to autostart.\n\n# Why this library?\n\nIn my experience so far when using Firebase to integrate cloud messaging or notifications in app, phones running stock android OS receive notifications\nperfectly whereas phones which have custom UI installed on them from the OEM such as Xiaomi, Letv do not receive any fcm calls.\n\nThis is because the OEM's by defaut _add an unrecognized app to the blacklist_ which prevents it from running in the\nbackground and receiving notifications, apps like Whatsapp on the other hand are known apps which are whitelisted by the OEM and can hence receive notifications.\n\nTo work around this the user must allow your app to autostart which gives your app the required permission to run in the background and listen for any messages from Firebase.\nUnfortunately since this is an OEM specific problem and not an android sdk problem, there is no documented api for bringing up the autostart permission manager of a phone.\n\nEach manufacturer has their own version of it with different package names, hence this library was created to curate a list of all the packages used by each OEM for their version\nof the autostart permissiong manager.\n\n# Usage\n\n### Gradle\n\nAdd this to your module's `build.gradle` file:\n\n```groovy\ndependencies {\n        // ... other dependencies\n        implementation 'com.github.judemanutd:autostarter:1.1.0'\n}\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.judemanutd\u003c/groupId\u003e\n    \u003cartifactId\u003eautostarter\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.0\u003c/version\u003e\n    \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n \n Once you have integrated the library calling the following function will bring up the autostart permission manager of the phone. \n The function returns a boolean to indicate if the action was as success or a failure.\n \n Parameters\n * If true is passed as the second parameter, it will attempt to open the activity, otherwise it will just check its existence\n * if true is passed as the third parameter, the activity is attempted to be opened it will add FLAG_ACTIVITY_NEW_TASK to the intent\n \n ```kotlin\n     AutoStartPermissionHelper.getInstance().getAutoStartPermission(context)\n```\n\nIn order to check if your phone is supported by the library you can call the following command. If true is passed as the second parameter, the method will only return true if the screen is supported by the library. \nIf false, the method will return true as long as the permission exist even if the screen is not supported by the library.\n \n```kotlin\n     AutoStartPermissionHelper.getInstance().isAutoStartPermissionAvailable(context)\n```\n     \n In order to keep the library small and simple I have not included any dialogs or pop ups, It is upto you to provide the user with a message if necessary.\n \n On phones that are not running a custom UI or that do not require an autostart permission, this code will not open any new screen.\n \n ##### Note\n As of now the library has support for the following manufacturers :\n \n 1. Xiaomi\n 2. Redmi\n 3. Letv\n 4. Honor [ Untested ]\n 5. Oppo [ Untested ]\n 6. Vivo [ Untested ]\n 7. Huawei\n 8. Samsung\n 9. Asus\n 10. One Plus [ Untested ]\n\n I will be adding support for other manufacturers as and when possible. I am also open to PR's and contributions from others.\n\n## Related Info\n\nSince this depends entirely on the OEM and not on android itself, the underlying component that this library makes use of is continuously changing.\nDo check out these repositories for further information on this issue\n\n- [dont-kill-my-app](https://github.com/urbandroid-team/dont-kill-my-app)\n- [backgroundable-android](https://github.com/dirkam/backgroundable-android)\n- [AppKillerManager](https://github.com/thelittlefireman/AppKillerManager)\n- [CRomAppWhitelist](https://github.com/WanghongLin/CRomAppWhitelist)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjudemanutd%2FAutoStarter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjudemanutd%2FAutoStarter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjudemanutd%2FAutoStarter/lists"}