Hi there,
I’m a complete beginner at developing in iOS and am trying to get a simple example working with the spark-setup-ios Library, I’m porting it over to ReactNative.
The flow I’m aiming to get is as follows:
- User logs in to app with x API
- User puts button into setup mode and follows the Particle Setup instructions
- App retrieves the setup device id and posts it to x API along with the userID
Everything is working as expected I simply need access to a callback with the device id. Is there any way to get this? My code is as follows:
// RNParticle.m
#import "SparkSetup.h"
#import "RNParticle.h"
#import "AppDelegate.h"
@implementation RNParticle
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(open)
{
SparkSetupMainController *setupController = [[SparkSetupMainController alloc] initWithSetupOnly:YES];
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[delegate.window.rootViewController presentViewController:setupController animated:YES completion:nil];
}
@end