File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import type { PushData } from './Push';
21
21
type RequestOptions = {
22
22
useMasterKey ?: boolean ;
23
23
sessionToken ? : string ;
24
+ installationId ? : string ;
24
25
} ;
25
26
type AnalyticsController = {
26
27
track : ( name : string , dimensions : { [ key : string ] : string } ) => ParsePromise ;
Original file line number Diff line number Diff line change @@ -365,6 +365,9 @@ export default class ParseUser extends ParseObject {
365
365
if ( options . hasOwnProperty ( 'useMasterKey' ) ) {
366
366
signupOptions . useMasterKey = options . useMasterKey ;
367
367
}
368
+ if ( options . hasOwnProperty ( 'installationId' ) ) {
369
+ signupOptions . installationId = options . installationId ;
370
+ }
368
371
369
372
var controller = CoreManager . getUserController ( ) ;
370
373
return controller . signUp (
@@ -395,6 +398,9 @@ export default class ParseUser extends ParseObject {
395
398
if ( options . hasOwnProperty ( 'useMasterKey' ) ) {
396
399
loginOptions . useMasterKey = options . useMasterKey ;
397
400
}
401
+ if ( options . hasOwnProperty ( 'installationId' ) ) {
402
+ loginOptions . installationId = options . installationId ;
403
+ }
398
404
399
405
var controller = CoreManager . getUserController ( ) ;
400
406
return controller . logIn ( this , loginOptions ) . _thenRunCallbacks ( options , this ) ;
Original file line number Diff line number Diff line change @@ -17,13 +17,15 @@ import Storage from './Storage';
17
17
export type RequestOptions = {
18
18
useMasterKey ?: boolean ;
19
19
sessionToken ? : string ;
20
+ installationId ? : string ;
20
21
} ;
21
22
22
23
export type FullOptions = {
23
24
success ?: any ;
24
25
error ? : any ;
25
26
useMasterKey ? : boolean ;
26
27
sessionToken ? : string ;
28
+ installationId ? : string ;
27
29
} ;
28
30
29
31
var XHR = null ;
@@ -181,9 +183,16 @@ const RESTController = {
181
183
payload . _RevocableSession = '1' ;
182
184
}
183
185
184
- var installationController = CoreManager . getInstallationController ( ) ;
186
+ var installationId = options . installationId ;
187
+ var installationIdPromise ;
188
+ if ( installationId && typeof installationId === 'string' ) {
189
+ installationIdPromise = ParsePromise . as ( installationId ) ;
190
+ } else {
191
+ var installationController = CoreManager . getInstallationController ( ) ;
192
+ installationIdPromise = installationController . currentInstallationId ( ) ;
193
+ }
185
194
186
- return installationController . currentInstallationId ( ) . then ( ( iid ) => {
195
+ return installationIdPromise . then ( ( iid ) => {
187
196
payload . _InstallationId = iid ;
188
197
var userController = CoreManager . getUserController ( ) ;
189
198
if ( options && typeof options . sessionToken === 'string' ) {
You can’t perform that action at this time.
0 commit comments