File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 3838
3939- (void )setUserAttribute : (CDVInvokedUrlCommand *)command ;
4040
41+ - (void )removeUserAttribute : (CDVInvokedUrlCommand *)command ;
42+
4143@end
Original file line number Diff line number Diff line change @@ -1246,6 +1246,27 @@ - (void) setUserAttribute:(CDVInvokedUrlCommand*)command
12461246 [self .commandDelegate sendPluginResult: result callbackId: [command callbackId ]];
12471247 }
12481248
1249+ /* *
1250+ * Removes a given key and its associated value from user attributes.
1251+ * Does nothing if a key does not exist.
1252+ */
1253+ - (void ) removeUserAttribute:(CDVInvokedUrlCommand*)command
1254+ {
1255+ CDVPluginResult* result;
1256+
1257+ NSString * key = [command argumentAtIndex: 0 ];
1258+
1259+ if (key) {
1260+ [Instabug removeUserAttributeForKey: key];
1261+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
1262+ } else {
1263+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR
1264+ messageAsString: @" key parameter must be provided." ];
1265+ }
1266+
1267+ [self .commandDelegate sendPluginResult: result callbackId: [command callbackId ]];
1268+ }
1269+
12491270 /* *
12501271 * Shows one of the surveys that were not shown before, that also have
12511272 * conditions that match the current device/user.
You can’t perform that action at this time.
0 commit comments