# AI prompts

> Copy-paste prompts for coding agents: add deep linking to a screen, track a purchase, send yourself a test push.

Source: https://docs.grovs.io/docs/ai/prompts

Run them in Claude Code, Cursor or Copilot, inside your app's repository. Each prompt ends with links to the Markdown docs the agent should read, so it works from the current API rather than from memory. To add the SDK itself, start with the [integration prompts](https://docs.grovs.io/docs/ai#let-an-agent-integrate-the-sdk).

The examples use Medly, a fictional pharmacy app. Change the screen names, product IDs and event names to yours, and review the diff before you commit.

## Add deep linking to a screen

Routes a Grovs link to one screen, and adds a share button that makes links for it.

**Prompt for iOS**

```text
Grovs is already set up in this app. Add deep linking to the prescription refill screen.

1. In the existing grovsReceivedPayloadFromDeeplink(link:payload:tracking:) handler, when payload["screen"] is "refill", open the refill screen with payload["refill_id"]. Keep the other routes as they are.
2. Make sure the handler also works for a link that opened the app from a cold start and for a link delivered after install.
3. Add a Share button on the refill screen that calls Grovs.generateLink with title "Refill your prescription", data ["screen": "refill", "refill_id": the refill ID], and shares the URL with the system share sheet.
4. Tell me how to test it with a link from the Grovs dashboard.

Docs:
https://docs.grovs.io/docs/sdk/ios/deep-linking.md
https://docs.grovs.io/docs/sdk/ios/link-creation.md
```

For Android, Web, Flutter, React Native or Unity, swap the docs links for that platform's `deep-linking.md` and `link-creation.md` pages, for example `https://docs.grovs.io/docs/sdk/android/deep-linking.md`.

## Track a purchase

Reports purchases so revenue shows in Grovs and is attributed to the link that brought the buyer.

**Prompt for iOS**

```text
Grovs is already set up in this app. Report purchases to Grovs.

1. Find where the app finishes a StoreKit 2 purchase. After a verified transaction, call Grovs.logInAppPurchase(transactionID: transaction.id). Don't log the same transaction twice: when the completion reports false, the SDK keeps the purchase and retries it.
2. For purchases made outside the App Store (our web checkout), call Grovs.logCustomPurchase(type:priceInCents:currency:productID:) with the order's amount in cents and its ISO 4217 currency.
3. Track the paywall as an event with Grovs.track("paywall_viewed", properties: ["plan": the plan name]) so purchases can be compared with paywall views.
4. List the App Store Server Notifications setup I must do in App Store Connect and the Grovs dashboard.

Docs:
https://docs.grovs.io/docs/sdk/ios/revenue.md
https://docs.grovs.io/docs/sdk/ios/analytics.md
```

The same prompt works for other platforms with that platform's `revenue.md` page. On Android, Google Play purchases are logged with `Grovs.logInAppPurchase(purchase.originalJson)`; on the web, `Grovs.logCustomPurchase` needs a Grovs Enterprise backend, which Grovs Cloud runs.

## Send yourself a test push

Sends a push to your own devices with the [server push API](https://docs.grovs.io/docs/api-reference/server-push). Ask the agent to write a small script you run yourself, so your project key stays out of the chat.

**Prompt for iOS**

```text
Write a shell script, scripts/test-push.sh, that sends a Grovs push to my own devices.

1. Read GROVS_PROJECT_KEY and GROVS_USER_ID from the environment. Never print them.
2. Send POST https://sdk.sqd.link/api/v1/sdk/server/push with the headers PROJECT-KEY: $GROVS_PROJECT_KEY and ENVIRONMENT: test. Body: title "Test from Medly", body "If you see this, push works", and an audience of type "identifiers" whose recipients list holds only $GROVS_USER_ID.
3. Poll GET https://sdk.sqd.link/api/v1/sdk/server/push/CAMPAIGN_ID, using the id from the send response, until the status is sent or failed. Then print the report.

GROVS_USER_ID is the value the app sets in Grovs.userIdentifier. Check the push setup in the app against the docs and tell me if anything is missing.

Docs:
https://docs.grovs.io/docs/api-reference/server-push.md
https://docs.grovs.io/docs/sdk/ios/push-notifications.md
```

The server push API needs an active paid plan on grovs Cloud. The device must have a push token for the environment you send to. A build run from Xcode gets an APNs sandbox token, so pair it with `test`. On Android, SDK 3.1 reports the open; 3.0 does not. See [Android push notifications](https://docs.grovs.io/docs/sdk/android/push-notifications).

For in-app messages there is a built-in test: **Send test** on a campaign shows it on your devices at their next sync. See [iOS](https://docs.grovs.io/docs/sdk/ios/in-app-messages#test-messages) and [web](https://docs.grovs.io/docs/sdk/web/in-app-messages#test-messages).

## Prompts for the MCP server

With the [MCP server](https://docs.grovs.io/docs/ai/mcp/introduction) connected, ask your assistant in plain words:

- "Create a Grovs link for the spring refill campaign with path /spring-refill, data screen=refill, and the campaign name Spring 2026."
- "Which of my links got the most opens in the last 30 days?"
- "Set the iOS fallback for my Medly project to the App Store and the desktop redirect to <https://medly.example/download>."

More, with the tools each one calls: [Example prompts](https://docs.grovs.io/docs/ai/mcp/examples).
