You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,41 @@ This project assumes that you already have a few things setup.
29
29
30
30
---
31
31
32
-
## How to Setup Supabase
32
+
## Setup OneSignal App
33
+
34
+
### Setup iOS Platform
35
+
36
+
### Setup Android Platform
37
+
38
+
### Craft an In-App Message
39
+
40
+
Consent is required before we can present push notifications to a user. It's recommend to use an in-app message to ask for consent because no prior consent is needed to present them. This is particularly useful in situations where a user accidentally declines consent. We have an in-depth guide explaining this strategy [here](https://documentation.onesignal.com/docs/how-to-prompt-for-push-permissions-with-an-in-app-message).
41
+
42
+
1. Select **New Message -> New In-App** and name it "prompt_notification" 
43
+
44
+
2. Configure an in-app message with at least one button; here's the message with two buttons I configured for this sample using our Block Editor! 
45
+
46
+
3. Add the _Push Permission Prompt_**Click Action** to the primary call to action button. 
47
+
48
+
4. Select **Add Trigger -> In-App Trigger** to present the in-app message when specific conditions are met 
49
+
50
+
5. Schedule the message to start showing **Immediately**, to **Show forever**, and to show **Every time trigger conditions are satisfied**
51
+
52
+
6. Select **Make Message Live** to publish message
53
+
54
+
If you didn't name your in-app message "prompt_notification", you'll need to update the Flutter app's code to use your name.
55
+
56
+
#### Triggering in-app messages in the app
57
+
58
+
```dart
59
+
final deviceState = await OneSignal.shared.getDeviceState();
0 commit comments