diff --git a/android/src/main/java/br/com/classapp/RNSensitiveInfo/RNSensitiveInfoModule.java b/android/src/main/java/br/com/classapp/RNSensitiveInfo/RNSensitiveInfoModule.java index 15c43503..165c3ba7 100644 --- a/android/src/main/java/br/com/classapp/RNSensitiveInfo/RNSensitiveInfoModule.java +++ b/android/src/main/java/br/com/classapp/RNSensitiveInfo/RNSensitiveInfoModule.java @@ -43,7 +43,7 @@ public void setItem(String key, String value, ReadableMap options, Promise pm) { try { putExtra(key, value, prefs(name)); - pm.resolve(null); + pm.resolve(value); } catch (Exception e) { Log.d("RNSensitiveInfo", e.getCause().getMessage()); pm.reject(e); diff --git a/ios/RNSensitiveInfo/RNSensitiveInfo.m b/ios/RNSensitiveInfo/RNSensitiveInfo.m index 10f878fd..1c5ad90e 100644 --- a/ios/RNSensitiveInfo/RNSensitiveInfo.m +++ b/ios/RNSensitiveInfo/RNSensitiveInfo.m @@ -65,7 +65,7 @@ @implementation RNSensitiveInfo } -RCT_EXPORT_METHOD(setItem:(NSString*)key value:(NSString*)value options:(NSDictionary *)options){ +RCT_EXPORT_METHOD(setItem:(NSString*)key value:(NSString*)value options:(NSDictionary *)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){ NSString * keychainService = [RCTConvert NSString:options[@"keychainService"]]; if (keychainService == NULL) { @@ -81,6 +81,8 @@ @implementation RNSensitiveInfo OSStatus osStatus = SecItemDelete((__bridge CFDictionaryRef) query); osStatus = SecItemAdd((__bridge CFDictionaryRef) query, NULL); + + resolve(value); } RCT_EXPORT_METHOD(getItem:(NSString *)key options:(NSDictionary *)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){