Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/particle.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class Particle implements TNSParticleAPI {
return io.particle.android.sdk.cloud.ParticleCloudSDK.getCloud().getAccessToken();
}

public startDeviceSetupWizard(): Promise<boolean> {
public startDeviceSetupWizard(o?: { setupOnly: boolean; }): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
// note that since we _have_ to return an intent, the activity is relaunched, so there's some state juggling required in the app
const intent = AndroidApp.foregroundActivity.getIntent();
Expand All @@ -191,6 +191,7 @@ export class Particle implements TNSParticleAPI {
});
}


public getDeviceSetupCustomizer(): any {
// stub for getDeviceSetupCustomizer
}
Expand Down
2 changes: 1 addition & 1 deletion src/particle.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export interface TNSParticleAPI {

listDevices(): Promise<Array<TNSParticleDevice>>;

startDeviceSetupWizard(): Promise<boolean>;
startDeviceSetupWizard(o?: { setupOnly: boolean; }): Promise<boolean>;

getDeviceSetupCustomizer(): any;

Expand Down
7 changes: 5 additions & 2 deletions src/particle.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,12 @@ export class Particle implements TNSParticleAPI {
this.eventIds.delete(prefix);
}

public startDeviceSetupWizard(): Promise<boolean> {
public startDeviceSetupWizard(o?: { setupOnly: boolean; }): Promise<boolean> {
if (!o) {
o = { setupOnly: false };
}
return new Promise<boolean>((resolve, reject) => {
const setupController = ParticleSetupMainController.new();
const setupController = new ParticleSetupMainController({setupOnly: true});
this.wizardDelegate = ParticleSetupControllerDelegateImpl.createWithOwnerAndCallback(new WeakRef(this), (result: boolean) => resolve(result));
setupController.delegate = <any>this.wizardDelegate;
UIApplication.sharedApplication.keyWindow.rootViewController.presentViewControllerAnimatedCompletion(setupController, true, null);
Expand Down