Skip to content

Commit

Permalink
fix(ios): missing Ti.App.arguments and getArguments() APIs
Browse files Browse the repository at this point in the history
Fixes TIMOB-28507
  • Loading branch information
jquick-axway authored and ewanharris committed Jul 21, 2021
1 parent 61b9d07 commit 034afee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions iphone/Classes/AppModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- (void)fireEvent:(NSArray *)args;
- (int)garbageCollect:(NSArray *)args;

@property (nonatomic, readonly) NSDictionary *arguments;
@property (nonatomic, readonly) NSString *id;
@property (nonatomic, readonly) NSString *url;
@property (nonatomic, readonly) NSString *guid;
Expand Down
8 changes: 7 additions & 1 deletion iphone/Classes/AppModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,17 @@ - (void)accessibilityVoiceOverStatusChanged:(NSNotification *)notification
}
}

- (id)arguments:(id)args
- (NSDictionary *)arguments
{
return [[TiApp app] launchOptions];
}

- (id)getArguments:(id)args
{
DEPRECATED_REPLACED(@"App.getArguments()", @"10.0.0", @"App.arguments");
return self.arguments;
}

- (id)iD
{
return TI_APPLICATION_ID;
Expand Down
10 changes: 10 additions & 0 deletions tests/Resources/ti.app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ describe('Titanium.App', () => {
});
});

describe.ios('.arguments', () => {
it('is an Object', () => {
should(Ti.App).have.a.readOnlyProperty('arguments').which.is.an.Object();
});

it('has getter', () => {
should(Ti.App).have.a.getter('arguments');
});
});

describe('.copyright', () => {
it('is a read-only String', () => {
should(Ti.App).have.a.readOnlyProperty('copyright').which.is.a.String();
Expand Down

0 comments on commit 034afee

Please sign in to comment.