Personyze Wiki Personyze Wiki docs
English
Open Personyze
Docs/ Mobile Apps/ App push — your campaigns on your app users’ phones at once, and the App key
Mobile Apps

App push — your campaigns on your app users’ phones at once, and the App key

Upload your Apple push key or Firebase service account so a Send Web Push campaign reaches your Android and iOS apps at once, even when closed, and manage the App key your app puts…

6 min read Updated 1 hour ago

The App push card on Integrations is about your own Android and iOS apps. It holds two things: the push keys that let a Send Web Push campaign reach your app users’ phones at once, even with the app closed, through Apple’s and Google’s push services; and the App key, the key your app puts in its code. Your app needs the Personyze SDK, set up as Targeting & Personalization for Mobile Apps describes.

Your app gets its notifications without a push key too. With the SDK in place, a Send Web Push campaign already reaches your app: the app shows the notification when it next checks — as it opens, or in the background now and then. A push key makes it arrive at once. Each campaign’s statistics count the notifications shown and tapped either way.

Where it is

Open Integrations and the App push card: “Push campaigns to your Android and iOS apps at once, even when they are closed – through Apple’s and Google’s push services.” The card reads Connected once an Apple key or a Firebase service account is saved. The App push keys button on an app campaign’s Set up step opens it too.

iOS: Apple push key

  1. In your Apple Developer account: Certificates, Identifiers & Profiles › Keys, the + button, with Apple Push Notifications service (APNs) ticked. Download the .p8 file — Apple lets you download it once. One key serves every app of your team.
  2. On the card, under iOS: Apple push key, fill in the Key ID and your Team ID, choose the .p8 file and press Save. The Key ID may be left empty: it is in the file’s name, AuthKey_<Key ID>.p8. The Team ID is required.
  3. While it says Checking with Apple…, Personyze asks Apple whether it takes the key. A key Apple refuses is not kept, and Apple’s reason is shown.

In the app, the target needs the Push Notifications capability. The SDK asks iOS for the device token; your app delegate passes it on with Personyze.setPushToken, and your notification delegate hands taps to Personyze.handleNotificationResponse, so a tap opens where the notification leads and counts as a click. A Notification Service Extension of PersonyzeNotificationService adds the picture and buttons. The iOS SDK guide has the code.

Android: Firebase service account

  1. In the Firebase console of the project your Android app uses: Project settings › Service accounts › Generate new private key. This downloads a JSON file.
  2. On the card, under Android: Firebase service account, choose that file and press Save. Not google-services.json: that is your app’s own configuration and holds no key.
  3. While it says Checking with Firebase…, Personyze asks Google whether it takes the account. One Google refuses is not kept, and Google’s reason is shown.

In the app, the SDK depends on no Firebase library: your app uses Firebase Cloud Messaging itself. Its FirebaseMessagingService passes the token on with Personyze.setPushToken and hands each message to Personyze.handlePushMessage, which shows a Personyze notification and leaves your own messages to you. The app declares POST_NOTIFICATIONS itself. The Android SDK guide has the code.

Check that it works

Under each platform the card counts the devices your app registered: “1 device registered – the last …”, or “No iPhone has registered yet” until one has. Run your app with the SDK, allow notifications, and let it make its first request.

Once a key is saved, Send a test notification pushes one at once. Type a Visitor id (optional) to send it to that visitor’s devices, or leave it empty to send it to the devices that registered last (5 at most), and press Send. Each device gets a line with what Apple or Google answered:

  • accepted it — it appears on the phone now, or as soon as the phone is online;
  • says this device is gone — the app was removed, or the token is another app’s; the device is taken off the list;
  • refused the key or refused the notification — with their reason;
  • could not be reached, or was busy — try again in a minute.

A test notification counts for no campaign.

How campaigns use it

  • A Send Web Push campaign reaches your website’s subscribers and your app users alike. With a key, the app users get it at once, even with the app closed.
  • A campaign’s own notifications wait for the visitor’s visit to end, an hour and a half or more. Use the test notification to check the wiring, not a campaign.
  • A push that does not go is not lost: if Apple or Google refuse it, the app shows the notification when it next checks, as without a key.
  • The keys are kept encrypted and never shown again. The card shows the key’s ids (Key and Team, or the Firebase Project and its account), who added it and when, and Last pushed with — or, in red, why the last push was refused.
  • Removing a key (the bin beside it) asks first. Afterwards your app gets its notifications when it next checks for them, not at once.

The App key

Below the push keys is the App key: “The key your app puts in its code. It is made to ship inside an app: it can only do what the app SDK does.” Every copy of an app carries its key, and anyone who unpacks one can read it, so the App key can report screens and events, show what your campaigns decide and receive push notifications — nothing else. Any other use of it is refused. It needs the SDK 2.0 or later.

  • Create the App key makes it; Create another App key makes a second one, for instance for a second app. The Set up step of an app campaign has the same Create the App key button and fills the key into its code.
  • Unlike your account’s API key, the App key is shown in full: every copy of your app carries it anyway.
  • Revoking an App key (the bin beside it) stops every copy of your app that has it, those already installed too, from reaching Personyze. Make a new key and ship the app with it first.
  • Only the account owner and a Manager can see, create and revoke keys.
  • The App key is not a push key, and it is not your API key: anything else — the REST API, Zapier, Make, n8n, a server — uses the API key from Full-featured API. An app already released with your API key keeps working.

Limits

  • One Apple key and one Firebase service account per account. One Apple key covers every app of your Apple team; a Firebase service account covers the apps of its Firebase project.
  • Pushing at once needs the SDK set up for push in your app, as above. Without it, the key has no device to push to.
Get an AI plan for your site

Inspire me reads your website and suggests the personalization campaigns to run first, and who should see each one. Free.

Scan your site
Did this page answer your question?
Thank you — that goes to whoever maintains this page.