zendesk / react-native-sunshine-conversations

React Native wrapper for Smooch.io
MIT License
36 stars 26 forks source link

Exported smooch init method to RN #38

Closed abrel closed 6 years ago

abrel commented 6 years ago

This PR (ios) aims at exposing an init method directly from RN. Thus, RN users can avoid editing the AppDelegate.m file. Eventually, it is easier to maintain config for different env (CI etc...).

wmora commented 6 years ago

Thanks! We recently changed the signature for this method. Would you mind updating your code?

// Before
SKTSettings* settings = [SKTSettings settingsWithAppToken:@"YOUR_APP_TOKEN"];
[Smooch initWithSettings:settings];

// After
SKTSettings* settings = [SKTSettings settingsWithAppId:@"YOUR_APP_ID"];
[Smooch initWithSettings:settings completionHandler:^(NSError * _Nullable error, NSDictionary * _Nullable userInfo) {
    // Handle init result
}];