Skip to content

Forwarding Text Messages From iPhone To Android with ntfy

In this page I documented how I set up forwarding text messages from my iPhone to my Android device using ntfy.

Get Started

  1. Install ntfy app on Android device.

  2. Subscribe to a topic, e.g., my-topic.

  3. Save this shortcut to your iPhone.

  4. In the above shortcut, fill in the topic that you are subscribing to. Note that by default everyone can read/send messages for this topic.

  5. Set up an automation on your iPhone to run the shortcut when you receive a new text message. Remember to select Run Immediately for automation.

Self Hosting

I opted for self hosting with docker compose on my Ubuntu remote server. I used nginx proxy manager for proxy and access tokens via Bearer auth for authentication.

  1. Set up the following docker-compose file and run docker compose up -d.

    docker-compose.yml
    version: '3'
    services:
    ntfy:
    image: binwiederhier/ntfy
    restart: unless-stopped
    environment:
    TZ: Asia/Shanghai
    NTFY_BASE_URL: <your-domain>
    NTFY_CACHE_FILE: /var/lib/ntfy/cache.db
    NTFY_AUTH_FILE: /var/lib/ntfy/auth.db
    NTFY_AUTH_DEFAULT_ACCESS: deny-all
    NTFY_BEHIND_PROXY: true
    NTFY_ATTACHMENT_CACHE_DIR: /var/lib/ntfy/attachments
    NTFY_ENABLE_LOGIN: true
    volumes:
    - ./:/var/lib/ntfy
    ports:
    - <your-port>:80
    command: serve
  2. Creat a user and a token with the following commands.

    ntfy user add --role=admin jack # Add admin user jack
    ntfy token add jack # Create token for user jack which never expires

    For more commands check out ntfy doc.

  3. On your Android ntfy app, go to Settings -> Users, add the user that you created earlier. Subscribe to the topic but this time with the self-host base url.

  4. On your iPhone shortcut, adjust the base url accordingly. Add a new header for the bearer token with Authorization: Bearer <your-token>