File tree 6 files changed +18
-18
lines changed
6 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3
- package=" __PACKAGE__ "
3
+ package=" com.company.android "
4
4
android:versionCode=" 1"
5
5
android:versionName=" 1.0" >
6
6
Original file line number Diff line number Diff line change 8
8
android {
9
9
defaultConfig {
10
10
generatedDensities = []
11
- applicationId = " org.nativescript.packagetest "
11
+ applicationId = " com.company.android "
12
12
13
13
// override supported platforms
14
14
// ndk {
Original file line number Diff line number Diff line change 8
8
<string >${PRODUCT_NAME} </string >
9
9
<key >CFBundleExecutable </key >
10
10
<string >${EXECUTABLE_NAME} </string >
11
+ <key >CFBundleIdentifier </key >
12
+ <string >com.company.ios </string >
11
13
<key >CFBundleInfoDictionaryVersion </key >
12
14
<string >6.0 </string >
13
15
<key >CFBundleName </key >
Original file line number Diff line number Diff line change 1
1
< StackLayout class ="p-20 ">
2
- < Label text ="Tap the button " class ="h1 text-center "> </ Label >
3
- < Button text ="TAP " (tap) ="onTap() " class ="btn btn-primary btn-active "> </ Button >
4
- < Label [text] ="message " class ="h2 text-center " textWrap ="true "> </ Label >
2
+ < Label [text] ="packageId " class ="h2 text-center "> </ Label >
5
3
</ StackLayout >
Original file line number Diff line number Diff line change 1
- import { Component } from "@angular/core" ;
1
+ import { Component , OnInit } from "@angular/core" ;
2
+ import * as application from "application" ;
3
+
4
+ declare var NSBundle : any ;
2
5
3
6
@Component ( {
4
7
selector : "my-app" ,
5
8
templateUrl : "app.component.html" ,
6
9
} )
7
- export class AppComponent {
8
- public counter : number = 16 ;
10
+ export class AppComponent implements OnInit {
11
+
12
+ packageId : string = "loading..." ;
9
13
10
- public get message ( ) : string {
11
- if ( this . counter > 0 ) {
12
- return this . counter + " taps left" ;
13
- } else {
14
- return "Hoorraaay! \nYou are ready to start building!" ;
14
+ ngOnInit ( ) {
15
+ if ( application . ios ) {
16
+ this . packageId = NSBundle . mainBundle . bundleIdentifier ;
17
+ } else if ( application . android ) {
18
+ this . packageId = application . android . context . getPackageName ( ) ;
15
19
}
16
20
}
17
-
18
- public onTap ( ) {
19
- this . counter -- ;
20
- }
21
21
}
Original file line number Diff line number Diff line change 4
4
"readme" : " NativeScript Application" ,
5
5
"repository" : " <fill-your-repository-here>" ,
6
6
"nativescript" : {
7
- "id" : " org.nativescript.packagetest " ,
7
+ "id" : " com.company.nativescript " ,
8
8
"tns-ios" : {
9
9
"version" : " 2.4.0"
10
10
},
You can’t perform that action at this time.
0 commit comments