An open API service indexing awesome lists of open source software.

https://github.com/entria/react-native-datami


https://github.com/entria/react-native-datami

datami react-native

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# react-native-datami

## Getting started

`$ npm install react-native-datami --save`

### Mostly automatic installation

`$ react-native link react-native-datami`

### Manual installation

#### iOS

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-datami` and add `RNDatami.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNDatami.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<

### How I did it

Search all `NSURLSessionConfiguration` references, and add this line after it

```objective-c
[SmiSdk registerAppConfiguration: configuration];
```

#### Example

```diff
(NSURLSessionDataTask *)sendRequest:(NSURLRequest *)request
withDelegate:(id)delegate
{
// Lazy setup
if (!_session && [self isValid]) {
NSOperationQueue *callbackQueue = [NSOperationQueue new];
callbackQueue.maxConcurrentOperationCount = 1;
callbackQueue.underlyingQueue = [[_bridge networking] methodQueue];
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+ [SmiSdk registerAppConfiguration: configuration];
_session = [NSURLSession sessionWithConfiguration:configuration
delegate:self
delegateQueue:callbackQueue];

std::lock_guard lock(_mutex);
_delegates = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory
valueOptions:NSPointerFunctionsStrongMemory
capacity:0];
}

NSURLSessionDataTask *task = [_session dataTaskWithRequest:request];
{
std::lock_guard lock(_mutex);
[_delegates setObject:delegate forKey:task];
}
[task resume];
return task;
}
```

#### Android

This is only needed on iOS