PHP/MySQL实现向iOS/Android设备发送系统级定时提醒的问询
Hey Dave, let's break down your problem clearly since you're working with PHP/MySQL and trying to avoid those annual developer fees. First, let's address your core question, then dive into practical solutions.
Do you need a developer ID?
Let's split this by platform:
- iOS (APNs): Yes, there's no way around the $99/year Apple Developer Program fee if you want to send native push notifications directly to iOS devices. Apple restricts access to APNs (their push service) exclusively to registered developers—you need either a push certificate or token, both of which require a developer account to generate.
- Android (FCM): Google's Firebase Cloud Messaging doesn't charge an annual fee. You only pay a one-time $25 registration fee for a Google Developer account, and the free tier of FCM is more than enough for most small-scale use cases. That said, you still need a minimal Android app to collect device tokens (more on that later).
Wait, but there's a critical point you might have missed: Native push notifications (like Apple's Reminders app) require an associated app installed on the device. Even if the app is in the background, it needs to exist, request push permissions, and provide a token for the push service to target. You can't send a system-level pop-up reminder to an iOS/Android device without a dedicated app (or using a pre-installed app like Telegram/Slack, which we'll cover).
Practical Solutions to Avoid Annual Fees
Since you want to skip Apple's annual fee and stick to PHP/MySQL, here are your best options:
1. Use Messaging Apps as a Proxy
Leverage popular apps that users already have installed—these apps handle the push infrastructure for you, and you can send reminders via their APIs:
- Telegram Bot: Create a free Telegram bot, have users subscribe to it, then send reminders using the Telegram Bot API. Messages will pop up as system notifications on both iOS and Android. This is 100% free, no developer fees required.
- Slack: Similar to Telegram—set up a workspace or channel, invite users, and send messages via the Slack API. Notifications will appear as system alerts if users have Slack configured that way.
- SMS/Email: While not a native pop-up reminder, SMS or push-enabled emails can still deliver timely alerts. Services like Twilio (SMS) or SendGrid (email) have free tiers for small volumes, and integrating them with PHP is straightforward.
2. Minimal Android App + FCM (No Annual Fee)
If you specifically want native Android push notifications:
- Sign up for a free Firebase account (after the one-time $25 Google Developer registration).
- Build a super simple Android app (you can use no-code tools like Adalo or Appy Pie if you don't know Java/Kotlin) that only requests push permissions and sends the FCM token to your PHP/MySQL backend.
- Use PHP to call the FCM API and send reminders to stored tokens—here's a quick example:
<?php $apiKey = 'YOUR_FCM_SERVER_KEY'; $deviceToken = 'STORED_DEVICE_TOKEN'; $notification = [ 'title' => 'Scheduled Reminder', 'body' => 'Your time-sensitive alert is here!', 'sound' => 'default' ]; $payload = json_encode([ 'to' => $deviceToken, 'notification' => $notification, 'priority' => 'high' ]); $ch = curl_init('https://fcm.googleapis.com/fcm/send'); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: key=' . $apiKey, 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); echo $result; ?>
3. Third-Party Push Services (Partial Fee Avoidance)
Some services handle the Apple/Google developer account overhead for you, but most still require you to provide an Apple developer account for iOS. However, if you only care about Android, services like OneSignal or Pushwoosh offer free tiers and simplify push integration with PHP APIs.
Final Recommendation
If you want to avoid all developer fees entirely, go with the Telegram Bot or SMS/Email route—it's the quickest, cheapest way to send cross-platform reminders that pop up on devices. If you need native Android push notifications, the FCM + minimal app approach is affordable and fits your PHP/MySQL stack. For iOS, unfortunately, you can't get around the annual Apple developer fee if you want native push alerts.
内容的提问来源于stack exchange,提问作者Dave33

