Skip to content

Commit 1d5506e

Browse files
shepherd-lnan-li
authored andcommitted
Add get tags button
1 parent 1c960ff commit 1d5506e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

example/lib/main.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ class _MyAppState extends State<MyApp> {
140140
OneSignal.User.removeTags(['test']);
141141
}
142142

143+
void _handleGetTags() async {
144+
print("Get tags");
145+
146+
var tags = await OneSignal.User.getTags();
147+
print(tags);
148+
}
149+
143150
void _handlePromptForPushPermission() {
144151
print("Prompting for Permission");
145152
OneSignal.Notifications.requestPermission(true);
@@ -270,6 +277,10 @@ class _MyAppState extends State<MyApp> {
270277
new OneSignalButton(
271278
"Send Tags", _handleSendTags, !_enableConsentButton)
272279
]),
280+
new TableRow(children: [
281+
new OneSignalButton(
282+
"Get Tags", _handleGetTags, !_enableConsentButton)
283+
]),
273284
new TableRow(children: [
274285
new OneSignalButton("Prompt for Push Permission",
275286
_handlePromptForPushPermission, !_enableConsentButton)

0 commit comments

Comments
 (0)