gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

The Background Fetch Id might collide with other apps #180

Open younesouhbi opened 7 months ago

younesouhbi commented 7 months ago

First, thank you for this plugin. It has saved me a lot of time and made my app idea possible without noticeably more development time.

I have a question regarding the Id used for the background fetch, currently, it's set to "com.gdelataillade.fetch". If two apps that use your plugin are deployed to the same device, will that cause an issue?

According to Apple, these identifiers need to use reverse URL, which is used to guarantee uniqueness. Are devs encouraged to change this string to represent their apps, because the current value is too generic as it doesn't contain the name of the app for example.

Thank you!

gdelataillade commented 7 months ago

Hi @younesouhbi

I did some research and it looks you're right ! Two apps in the same device that uses my plugin could have conflicts. I will have to find a way to let the plugin users choose their own id for background fetch.

To be honest I have a lot of other important issues to deal with at the moment but I'll add it to my to do list. In the meantime, you can just directly modify the id in the code, in the plugin's SwiftAlarmPlugin class (ios/Classes/SwiftAlarmPlugin.swift) and in your Info.plist (key BGTaskSchedulerPermittedIdentifiers).

Thanks for reporting this issue and I'll keep you updated !