Skip to content

Commit fbdb17d

Browse files
Add iOS API getAllUserAttributes
1 parent dd17f94 commit fbdb17d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/ios/IBGPlugin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@
4242

4343
- (void)getUserAttribute:(CDVInvokedUrlCommand *)command;
4444

45+
- (void)getAllUserAttributes:(CDVInvokedUrlCommand *)command;
46+
4547
@end

src/ios/IBGPlugin.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,20 @@ - (void) getUserAttribute:(CDVInvokedUrlCommand*)command
12821282
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
12831283
}
12841284

1285+
/**
1286+
* Returns the user attribute associated with a given key.
1287+
*/
1288+
- (void) getAllUserAttributes:(CDVInvokedUrlCommand*)command
1289+
{
1290+
CDVPluginResult* result;
1291+
1292+
NSDictionary* userAttributes = @[[Instabug userAttributes]];
1293+
1294+
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:userAttributes];
1295+
1296+
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
1297+
}
1298+
12851299
/**
12861300
* Shows one of the surveys that were not shown before, that also have
12871301
* conditions that match the current device/user.

0 commit comments

Comments
 (0)