Skip to content

Commit 8ebcc94

Browse files
authored
Merge branch 'main' into chore/background-http
2 parents 2c05413 + fe5af0b commit 8ebcc94

File tree

1,629 files changed

+158520
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,629 files changed

+158520
-51
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,9 @@ packages/shared-notification-delegate/common.js.map
5454
# iOS:
5555
packages/**/native-src/ios/**/xcuserdata/
5656
packages/**/native-src/ios/**/project.xcworkspace/
57-
packages/**/native-src/ios/**/build
57+
packages/**/native-src/ios/**/build
58+
59+
# Ionic Portals and testing
60+
!packages/ionic-portals/platforms/android/IonicPortals-release.aar
61+
tools/assets/App_Resources/iOS/ionicWebPortalSample
62+
tools/assets/App_Resources/Android/src/main/assets/ionicWebPortalSample

.husky/pre-commit

100644100755
File mode changed.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [@nativescript/biometrics](packages/biometrics/README.md)
77
- [@nativescript/brightness](packages/brightness/README.md)
88
- [@nativescript/camera](packages/camera/README.md)
9+
- [@nativescript/contacts](packages/contacts/README.md)
910
- [@nativescript/datetimepicker](packages/datetimepicker/README.md)
1011
- [@nativescript/debug-android](packages/debug-android/README.md)
1112
- [@nativescript/debug-ios](packages/debug-ios/README.md)
@@ -15,8 +16,10 @@
1516
- [@nativescript/facebook](packages/facebook/README.md)
1617
- [@nativescript/fingerprint-auth](packages/fingerprint-auth/README.md)
1718
- [@nativescript/geolocation](packages/geolocation/README.md)
19+
- [@nativescript/google-maps](packages/google-maps/README.md)
1820
- [@nativescript/google-signin](packages/google-signin/README.md)
1921
- [@nativescript/imagepicker](packages/imagepicker/README.md)
22+
- [@nativescript/ionic-portals](packages/ionic-portals/README.md)
2023
- [@nativescript/ios-security](packages/ios-security/README.md)
2124
- [@nativescript/iqkeyboardmanager](packages/iqkeyboardmanager/README.md)
2225
- [@nativescript/local-notifications](packages/local-notifications/README.md)

apps/demo-angular/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
"main": "./src/main.ts",
33
"dependencies": {
44
"@nativescript/core": "file:../../node_modules/@nativescript/core",
5-
"@nativescript/biometrics": "file:../../dist/packages/biometrics",
6-
"@nativescript/theme-switcher": "file:../../dist/packages/theme-switcher",
5+
"@nativescript/ionic-portals": "file:../../dist/packages/ionic-portals",
76
"@nativescript/animated-circle": "file:../../dist/packages/animated-circle",
87
"@nativescript/appavailability": "file:../../dist/packages/appavailability",
8+
"@nativescript/apple-sign-in": "file:../../dist/packages/apple-sign-in",
99
"@nativescript/auto-fit-text": "file:../../dist/packages/auto-fit-text",
1010
"@nativescript/background-http": "file:../../dist/packages/background-http",
11+
"@nativescript/biometrics": "file:../../dist/packages/biometrics",
1112
"@nativescript/brightness": "file:../../dist/packages/brightness",
1213
"@nativescript/camera": "file:../../dist/packages/camera",
14+
"@nativescript/contacts": "file:../../dist/packages/contacts",
1315
"@nativescript/datetimepicker": "file:../../dist/packages/datetimepicker",
1416
"@nativescript/debug-android": "file:../../dist/packages/debug-android",
1517
"@nativescript/debug-ios": "file:../../dist/packages/debug-ios",
@@ -19,6 +21,7 @@
1921
"@nativescript/facebook": "file:../../dist/packages/facebook",
2022
"@nativescript/fingerprint-auth": "file:../../dist/packages/fingerprint-auth",
2123
"@nativescript/geolocation": "file:../../dist/packages/geolocation",
24+
"@nativescript/google-maps": "file:../../dist/packages/google-maps",
2225
"@nativescript/google-signin": "file:../../dist/packages/google-signin",
2326
"@nativescript/imagepicker": "file:../../dist/packages/imagepicker",
2427
"@nativescript/ios-security": "file:../../dist/packages/ios-security",
@@ -28,9 +31,9 @@
2831
"@nativescript/picker": "file:../../dist/packages/picker",
2932
"@nativescript/shared-notification-delegate": "file:../../dist/packages/shared-notification-delegate",
3033
"@nativescript/social-share": "file:../../dist/packages/social-share",
34+
"@nativescript/theme-switcher": "file:../../dist/packages/theme-switcher",
3135
"@nativescript/twitter": "file:../../dist/packages/twitter",
32-
"@nativescript/zip": "file:../../dist/packages/zip",
33-
"@nativescript/apple-sign-in": "file:../../dist/packages/apple-sign-in"
36+
"@nativescript/zip": "file:../../dist/packages/zip"
3437
},
3538
"devDependencies": {
3639
"@nativescript/android": "~8.1.1",

apps/demo-angular/src/app-routing.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const routes: Routes = [
1515
{ path: 'biometrics', loadChildren: () => import('./plugin-demos/biometrics.module').then(m => m.BiometricsModule) },
1616
{ path: 'brightness', loadChildren: () => import('./plugin-demos/brightness.module').then(m => m.BrightnessModule) },
1717
{ path: 'camera', loadChildren: () => import('./plugin-demos/camera.module').then(m => m.CameraModule) },
18+
{ path: 'contacts', loadChildren: () => import('./plugin-demos/contacts.module').then(m => m.ContactsModule) },
1819
{ path: 'datetimepicker', loadChildren: () => import('./plugin-demos/datetimepicker.module').then(m => m.DatetimepickerModule) },
1920
{ path: 'debug-android', loadChildren: () => import('./plugin-demos/debug-android.module').then(m => m.DebugAndroidModule) },
2021
{ path: 'debug-ios', loadChildren: () => import('./plugin-demos/debug-ios.module').then(m => m.DebugIosModule) },
@@ -24,8 +25,10 @@ const routes: Routes = [
2425
{ path: 'facebook', loadChildren: () => import('./plugin-demos/facebook.module').then(m => m.FacebookModule) },
2526
{ path: 'fingerprint-auth', loadChildren: () => import('./plugin-demos/fingerprint-auth.module').then(m => m.FingerprintAuthModule) },
2627
{ path: 'geolocation', loadChildren: () => import('./plugin-demos/geolocation.module').then(m => m.GeolocationModule) },
28+
{ path: 'google-maps', loadChildren: () => import('./plugin-demos/google-maps.module').then(m => m.GoogleMapsModule) },
2729
{ path: 'google-signin', loadChildren: () => import('./plugin-demos/google-signin.module').then(m => m.GoogleSigninModule) },
2830
{ path: 'imagepicker', loadChildren: () => import('./plugin-demos/imagepicker.module').then(m => m.ImagepickerModule) },
31+
{ path: 'ionic-portals', loadChildren: () => import('./plugin-demos/ionic-portals.module').then(m => m.IonicPortalsModule) },
2932
{ path: 'ios-security', loadChildren: () => import('./plugin-demos/ios-security.module').then(m => m.IosSecurityModule) },
3033
{ path: 'iqkeyboardmanager', loadChildren: () => import('./plugin-demos/iqkeyboardmanager.module').then(m => m.IqkeyboardmanagerModule) },
3134
{ path: 'local-notifications', loadChildren: () => import('./plugin-demos/local-notifications.module').then(m => m.LocalNotificationsModule) },

apps/demo-angular/src/home.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export class HomeComponent {
3030
{
3131
name: 'camera'
3232
},
33+
{
34+
name: 'contacts'
35+
},
3336
{
3437
name: 'datetimepicker'
3538
},
@@ -57,12 +60,18 @@ export class HomeComponent {
5760
{
5861
name: 'geolocation'
5962
},
63+
{
64+
name: 'google-maps'
65+
},
6066
{
6167
name: 'google-signin'
6268
},
6369
{
6470
name: 'imagepicker'
6571
},
72+
{
73+
name: 'ionic-portals'
74+
},
6675
{
6776
name: 'ios-security'
6877
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="contacts" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test contacts" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedContacts } from '@demo/shared';
3+
import { } from '@nativescript/contacts';
4+
5+
@Component({
6+
selector: 'demo-contacts',
7+
templateUrl: 'contacts.component.html',
8+
})
9+
export class ContactsComponent {
10+
11+
demoShared: DemoSharedContacts;
12+
13+
constructor(private _ngZone: NgZone) {}
14+
15+
ngOnInit() {
16+
this.demoShared = new DemoSharedContacts();
17+
}
18+
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3+
import { ContactsComponent } from './contacts.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: ContactsComponent }])],
7+
declarations: [ContactsComponent],
8+
schemas: [ NO_ERRORS_SCHEMA]
9+
})
10+
export class ContactsModule {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="google-maps" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test google-maps" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedGoogleMaps } from '@demo/shared';
3+
import { } from '@nativescript/google-maps';
4+
5+
@Component({
6+
selector: 'demo-google-maps',
7+
templateUrl: 'google-maps.component.html',
8+
})
9+
export class GoogleMapsComponent {
10+
11+
demoShared: DemoSharedGoogleMaps;
12+
13+
constructor(private _ngZone: NgZone) {}
14+
15+
ngOnInit() {
16+
this.demoShared = new DemoSharedGoogleMaps();
17+
}
18+
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3+
import { GoogleMapsComponent } from './google-maps.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: GoogleMapsComponent }])],
7+
declarations: [GoogleMapsComponent],
8+
schemas: [ NO_ERRORS_SCHEMA]
9+
})
10+
export class GoogleMapsModule {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="ionic-portals" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test ionic portals" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedIonicPortals } from '@demo/shared';
3+
import { } from '@nativescript/ionic-portals';
4+
5+
@Component({
6+
selector: 'demo-ionic-portals',
7+
templateUrl: 'ionic-portals.component.html',
8+
})
9+
export class IonicPortalsComponent {
10+
11+
demoShared: DemoSharedIonicPortals;
12+
13+
constructor(private _ngZone: NgZone) {}
14+
15+
ngOnInit() {
16+
this.demoShared = new DemoSharedIonicPortals();
17+
}
18+
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3+
import { IonicPortalsComponent } from './ionic-portals.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: IonicPortalsComponent }])],
7+
declarations: [IonicPortalsComponent],
8+
schemas: [ NO_ERRORS_SCHEMA]
9+
})
10+
export class IonicPortalsModule {}

apps/demo/nativescript.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@ export default {
1010
appPath: 'src',
1111
cli: {
1212
packageManager: 'npm'
13-
}
13+
},
14+
hooks: [
15+
{
16+
type: 'before-prepare',
17+
script: '../../tools/scripts/before-prepare.js',
18+
}
19+
],
1420
} as NativeScriptConfig;

apps/demo/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"license": "SEE LICENSE IN <your-license-filename>",
55
"repository": "<fill-your-repository-here>",
66
"dependencies": {
7+
"@nativescript/ionic-portals": "file:../../packages/ionic-portals",
78
"@nativescript/animated-circle": "file:../../packages/animated-circle",
89
"@nativescript/appavailability": "file:../../packages/appavailability",
910
"@nativescript/apple-sign-in": "file:../../packages/apple-sign-in",
@@ -13,6 +14,7 @@
1314
"@nativescript/brightness": "file:../../packages/brightness",
1415
"@nativescript/camera": "file:../../packages/camera",
1516
"@nativescript/core": "file:../../node_modules/@nativescript/core",
17+
"@nativescript/contacts": "file:../../packages/contacts",
1618
"@nativescript/datetimepicker": "file:../../packages/datetimepicker",
1719
"@nativescript/debug-android": "file:../../packages/debug-android",
1820
"@nativescript/debug-ios": "file:../../packages/debug-ios",
@@ -22,6 +24,7 @@
2224
"@nativescript/facebook": "file:../../packages/facebook",
2325
"@nativescript/fingerprint-auth": "file:../../packages/fingerprint-auth",
2426
"@nativescript/geolocation": "file:../../packages/geolocation",
27+
"@nativescript/google-maps": "file:../../packages/google-maps",
2528
"@nativescript/google-signin": "file:../../packages/google-signin",
2629
"@nativescript/imagepicker": "file:../../packages/imagepicker",
2730
"@nativescript/ios-security": "file:../../packages/ios-security",

apps/demo/src/app.scss

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
11
@import 'nativescript-theme-core/scss/light';
2-
@import 'nativescript-theme-core/scss/index';
2+
@import 'nativescript-theme-core/scss/index';
3+
4+
Button {
5+
text-transform: none;
6+
height: 54;
7+
android-elevation: 0;
8+
android-dynamic-elevation-offset: 0;
9+
padding: 0;
10+
margin: 0;
11+
12+
&.btn {
13+
padding: 0;
14+
margin: 2 0 2 0;
15+
16+
&.btn-primary {
17+
background-color: rgb(95, 185, 249);
18+
}
19+
}
20+
}
21+
TextField {
22+
border-bottom-width: 1;
23+
border-bottom-color: transparent;
24+
font-size: 17;
25+
placeholder-color: rgb(201, 201, 201);
26+
padding-top: 0;
27+
padding-bottom: 0;
28+
margin-top: 0;
29+
margin-bottom: 0;
30+
height: 29;
31+
}

apps/demo/src/app.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
import { Application } from '@nativescript/core';
2-
import { LoginManager } from '@nativescript/facebook';
3-
import { init } from '@nativescript/background-http';
42

5-
LoginManager.init();
6-
init();
3+
// uncomment to test background http
4+
// import { init } from '@nativescript/background-http';
5+
// init();
6+
7+
// uncomment to test facebook login
8+
// import { LoginManager } from '@nativescript/facebook';
9+
// LoginManager.init();
10+
11+
// uncomment to test Ionic Portals
12+
// import { IonicPortalManager } from '@nativescript/ionic-portals';
13+
14+
// Application.on(Application.launchEvent, () => {
15+
// // Register IonicPortals
16+
// IonicPortalManager.register('<portal-api-key>');
17+
18+
// // Create as many Portals as you need to use in your app
19+
// IonicPortalManager.create('ionicWebPortalSample');
20+
// });
721

822
Application.run({ moduleName: 'app-root' });

apps/demo/src/main-page.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
<StackLayout>
88
<Button text="animated-circle" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
99
<Button text="appavailability" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
10+
<Button text="apple-sign-in" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1011
<Button text="auto-fit-text" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1112
<Button text="background-http" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1213
<Button text="biometrics" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1314
<Button text="brightness" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1415
<Button text="camera" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
16+
<Button text="contacts" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1517
<Button text="datetimepicker" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1618
<Button text="debug-android" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1719
<Button text="debug-ios" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
@@ -21,8 +23,10 @@
2123
<Button text="facebook" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2224
<Button text="fingerprint-auth" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2325
<Button text="geolocation" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
26+
<Button text="google-maps" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2427
<Button text="google-signin" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2528
<Button text="imagepicker" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
29+
<Button text="ionic-portals" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2630
<Button text="ios-security" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2731
<Button text="iqkeyboardmanager" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2832
<Button text="local-notifications" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
@@ -33,7 +37,6 @@
3337
<Button text="theme-switcher" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
3438
<Button text="twitter" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
3539
<Button text="zip" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
36-
<Button text="apple-sign-in" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
3740
</StackLayout>
3841
</ScrollView>
3942
</StackLayout>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
import { DemoSharedContacts } from '@demo/shared';
3+
import { } from '@nativescript/contacts';
4+
5+
export function navigatingTo(args: EventData) {
6+
const page = <Page>args.object;
7+
page.bindingContext = new DemoModel();
8+
}
9+
10+
export class DemoModel extends DemoSharedContacts {
11+
12+
}

0 commit comments

Comments
 (0)