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';
2121type RequestOptions = {
2222 useMasterKey ?: boolean ;
2323 sessionToken ? : string ;
24+ installationId ? : string ;
2425} ;
2526type AnalyticsController = {
2627 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 {
365365 if ( options . hasOwnProperty ( 'useMasterKey' ) ) {
366366 signupOptions . useMasterKey = options . useMasterKey ;
367367 }
368+ if ( options . hasOwnProperty ( 'installationId' ) ) {
369+ signupOptions . installationId = options . installationId ;
370+ }
368371
369372 var controller = CoreManager . getUserController ( ) ;
370373 return controller . signUp (
@@ -395,6 +398,9 @@ export default class ParseUser extends ParseObject {
395398 if ( options . hasOwnProperty ( 'useMasterKey' ) ) {
396399 loginOptions . useMasterKey = options . useMasterKey ;
397400 }
401+ if ( options . hasOwnProperty ( 'installationId' ) ) {
402+ loginOptions . installationId = options . installationId ;
403+ }
398404
399405 var controller = CoreManager . getUserController ( ) ;
400406 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';
1717export type RequestOptions = {
1818 useMasterKey ?: boolean ;
1919 sessionToken ? : string ;
20+ installationId ? : string ;
2021} ;
2122
2223export type FullOptions = {
2324 success ?: any ;
2425 error ? : any ;
2526 useMasterKey ? : boolean ;
2627 sessionToken ? : string ;
28+ installationId ? : string ;
2729} ;
2830
2931var XHR = null ;
@@ -181,9 +183,16 @@ const RESTController = {
181183 payload . _RevocableSession = '1' ;
182184 }
183185
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+ }
185194
186- return installationController . currentInstallationId ( ) . then ( ( iid ) => {
195+ return installationIdPromise . then ( ( iid ) => {
187196 payload . _InstallationId = iid ;
188197 var userController = CoreManager . getUserController ( ) ;
189198 if ( options && typeof options . sessionToken === 'string' ) {
You can’t perform that action at this time.
0 commit comments