Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master: (50 commits)
  feat(Device): Add getBatteryInfo function (ionic-team#2435)
  fix(doctor): add electron checks (ionic-team#2434)
  chore(android): target SDK version 29 (ionic-team#2433)
  feat(android): update gradle and dependencies (ionic-team#2431)
  fix(ios): Make Clipboard plugin return errors (ionic-team#2430)
  feat(android): Handle onDestroy lifecycle event in plugins (ionic-team#2421)
  docs(ce-plugins): Remove or replace deprecated plugins (ionic-team#2419)
  feat(ios): change native location accuracy values (ionic-team#2420)
  docs(ce-guides): Remove dead link (ionic-team#2418)
  docs(network): Remove example guide because of dead link (ionic-team#2417)
  feat(electron): Remove injectCapacitor function (ionic-team#2415)
  fix(android): plugin retained events not being retained if listeners were empty (ionic-team#2408)
  chore(android): remove unused launch_splash.xml (ionic-team#2411)
  feat(Filesystem): Remove createIntermediateDirectories from MkdirOptions (ionic-team#2410)
  feat(android): use Fused Location Provider on Geolocation plugin (ionic-team#2409)
  fix(toast): unify duration across platforms (ionic-team#2340)
  feat(PushNotifications): Make register method return if permission was granted (ionic-team#2324)
  chore(circleci): update Xcode and remove install-cocoapods job (ionic-team#2402)
  chore(cli): fix tests for newer node versions (ionic-team#2403)
  fix(android): return original camera image if edition was canceled (ionic-team#2358)
  ...
  • Loading branch information
chrisweight committed Feb 17, 2020
2 parents c9715bf + 0deca04 commit de72bcd
Show file tree
Hide file tree
Showing 111 changed files with 1,625 additions and 1,660 deletions.
22 changes: 4 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,9 @@ jobs:
steps:
- checkout

install-cocoapods:
macos:
xcode: "10.0"
working_directory: /tmp/workspace
steps:
- run:
name: Install CocoaPods
command: |
curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
run-cli-tests:
macos:
xcode: "10.0"
xcode: "11.1.0"
working_directory: /tmp/workspace

steps:
Expand All @@ -39,7 +29,7 @@ jobs:

build-ios:
macos:
xcode: "10.0"
xcode: "11.1.0"
working_directory: /tmp/workspace

steps:
Expand All @@ -51,7 +41,7 @@ jobs:

build-android:
docker:
- image: circleci/android:api-28-node8-alpha
- image: circleci/android:api-29-node
working_directory: /tmp/workspace

steps:
Expand All @@ -65,12 +55,8 @@ workflows:
node-ios-android:
jobs:
- get-cli
- install-cocoapods
- run-cli-tests:
requires:
- get-cli
- install-cocoapods
- build-ios:
requires:
- install-cocoapods
- build-ios
- build-android
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
## [1.5.0](https://github.com/ionic-team/capacitor/compare/1.4.0...1.5.0) (2020-02-03)

### Bug Fixes

* fix(web/clipboard): allow writing empty string (#2371) ([4a41922](https://github.com/ionic-team/capacitor/commit/4a41922)), closes [#2371](https://github.com/ionic-team/capacitor/issues/2371)
* fix(android): add missing GPS tags to exif data (#2284) ([3b43df1](https://github.com/ionic-team/capacitor/commit/3b43df1)), closes [#2284](https://github.com/ionic-team/capacitor/issues/2284)
* fix(android): implement getDeliveredNotifications and removeDeliveredNotifications (#2266) ([d942523](https://github.com/ionic-team/capacitor/commit/d942523)), closes [#2266](https://github.com/ionic-team/capacitor/issues/2266)
* fix(android): make Browser plugin fire browserFinished (#2332) ([4f5a4fc](https://github.com/ionic-team/capacitor/commit/4f5a4fc)), closes [#2332](https://github.com/ionic-team/capacitor/issues/2332)
* fix(android): make Share properly share file urls (#2338) ([9226d77](https://github.com/ionic-team/capacitor/commit/9226d77)), closes [#2338](https://github.com/ionic-team/capacitor/issues/2338)
* fix(cli): handle edit-config with merge mode on application object (#2322) ([9e56701](https://github.com/ionic-team/capacitor/commit/9e56701)), closes [#2322](https://github.com/ionic-team/capacitor/issues/2322)
* fix(cli): linux not showing error message on open (#2336) ([72d07e0](https://github.com/ionic-team/capacitor/commit/72d07e0)), closes [#2336](https://github.com/ionic-team/capacitor/issues/2336)
* fix(cli): move Android Studio detection to avoid displaying registry errors (#2364) ([60cd80b](https://github.com/ionic-team/capacitor/commit/60cd80b)), closes [#2364](https://github.com/ionic-team/capacitor/issues/2364)
* fix(cli): use proper kebab-case name for npm package (#2276) ([c9f1511](https://github.com/ionic-team/capacitor/commit/c9f1511)), closes [#2276](https://github.com/ionic-team/capacitor/issues/2276)
* fix(cli): use rimraf instead of rm -rf (#2285) ([ec458c8](https://github.com/ionic-team/capacitor/commit/ec458c8)), closes [#2285](https://github.com/ionic-team/capacitor/issues/2285)
* fix(cordova): add new iOS Swift CDVCommandStatus enums (#2328) ([45244d6](https://github.com/ionic-team/capacitor/commit/45244d6)), closes [#2328](https://github.com/ionic-team/capacitor/issues/2328)
* fix(cordova): avoid build failure if plugin uses viewController.webView (#2330) ([69f589b](https://github.com/ionic-team/capacitor/commit/69f589b)), closes [#2330](https://github.com/ionic-team/capacitor/issues/2330)
* fix(cordova): patch CDVCapture bundle path (#2342) ([3f4bd1a](https://github.com/ionic-team/capacitor/commit/3f4bd1a)), closes [#2342](https://github.com/ionic-team/capacitor/issues/2342)
* fix(ios): avoid lock of subsequent plugin calls (#2317) ([02da187](https://github.com/ionic-team/capacitor/commit/02da187)), closes [#2317](https://github.com/ionic-team/capacitor/issues/2317)
* fix(ios): fire appStateChange in incoming calls (#2282) ([7fd0c7c](https://github.com/ionic-team/capacitor/commit/7fd0c7c)), closes [#2282](https://github.com/ionic-team/capacitor/issues/2282)
* fix(ios): incorrect behavior of appendingPathComponent when framework is present (#2309) ([0a25cce](https://github.com/ionic-team/capacitor/commit/0a25cce)), closes [#2309](https://github.com/ionic-team/capacitor/issues/2309)


### Features

* feat(ios/android): allow to position Toast (#2337) ([a1384d5](https://github.com/ionic-team/capacitor/commit/a1384d5)), closes [#2337](https://github.com/ionic-team/capacitor/issues/2337)
* feat(android): add group and groupSummary to LocalNotifications (#2385) ([8e8a157](https://github.com/ionic-team/capacitor/commit/8e8a157)), closes [#2385](https://github.com/ionic-team/capacitor/issues/2385)
* feat(android): add splashFullScreen configuration option (#2302) ([9521e0a](https://github.com/ionic-team/capacitor/commit/9521e0a)), closes [#2302](https://github.com/ionic-team/capacitor/issues/2302)
* feat(android): add support to custom sound on Push Notifications (#2362) ([284d4b2](https://github.com/ionic-team/capacitor/commit/284d4b2)), closes [#2362](https://github.com/ionic-team/capacitor/issues/2362)
* feat(cli): allow to modify cleartext setting from capacitor.config.json (#2397) ([181d564](https://github.com/ionic-team/capacitor/commit/181d564)), closes [#2397](https://github.com/ionic-team/capacitor/issues/2397)
* feat(ios): add configuration option for allowsLinkPreview (#2382) ([47b4d66](https://github.com/ionic-team/capacitor/commit/47b4d66)), closes [#2382](https://github.com/ionic-team/capacitor/issues/2382)
* feat(ios): add threadIdentifier and summaryArgument to LocalNotification (#2396) ([7c5f30b](https://github.com/ionic-team/capacitor/commit/7c5f30b)), closes [#2396](https://github.com/ionic-team/capacitor/issues/2396)
* feat(ios): Allow to configure WebView's ScrollView's content insets (#2392) ([1f7e40d](https://github.com/ionic-team/capacitor/commit/1f7e40d)), closes [#2392](https://github.com/ionic-team/capacitor/issues/2392)


### Docs

* site updates ([64286f8](https://github.com/ionic-team/capacitor/commit/64286f8))
* docs: add allowsLinkPreview configuration information (#2387) ([e603032](https://github.com/ionic-team/capacitor/commit/e603032)), closes [#2387](https://github.com/ionic-team/capacitor/issues/2387)
* docs: Add how to determine installed plugin version in project (#2319) ([580a236](https://github.com/ionic-team/capacitor/commit/580a236)), closes [#2319](https://github.com/ionic-team/capacitor/issues/2319)
* docs: fix broken link to Cordova project description (#2277) ([88ce7db](https://github.com/ionic-team/capacitor/commit/88ce7db)), closes [#2277](https://github.com/ionic-team/capacitor/issues/2277)
* docs(android-guide): fix typo (#2343) ([4475ed5](https://github.com/ionic-team/capacitor/commit/4475ed5)), closes [#2343](https://github.com/ionic-team/capacitor/issues/2343)
* docs(ce-plugins): add @rdlabo/capacitor-codescanner (#2344) ([b2522ca](https://github.com/ionic-team/capacitor/commit/b2522ca)), closes [#2344](https://github.com/ionic-team/capacitor/issues/2344)
* docs(ce-plugins): add Apple Login Plugin (#2267) ([663657d](https://github.com/ionic-team/capacitor/commit/663657d)), closes [#2267](https://github.com/ionic-team/capacitor/issues/2267)
* docs(ce-plugins): Add capacitor UDP plugin (#2314) ([e904eaa](https://github.com/ionic-team/capacitor/commit/e904eaa)), closes [#2314](https://github.com/ionic-team/capacitor/issues/2314)
* docs(ce-plugins): add capacitor-voice-recorder (#2378) ([9836d05](https://github.com/ionic-team/capacitor/commit/9836d05)), closes [#2378](https://github.com/ionic-team/capacitor/issues/2378)
* docs(ce-plugins): Update capacitor-admob plugin note (#2335) ([5aeb4e6](https://github.com/ionic-team/capacitor/commit/5aeb4e6)), closes [#2335](https://github.com/ionic-team/capacitor/issues/2335)
* docs(core): show array type instead of any (#2318) ([2b9fb4d](https://github.com/ionic-team/capacitor/commit/2b9fb4d)), closes [#2318](https://github.com/ionic-team/capacitor/issues/2318)
* docs(keyboard): Add Keyboard config info (#2245) ([3344af2](https://github.com/ionic-team/capacitor/commit/3344af2)), closes [#2245](https://github.com/ionic-team/capacitor/issues/2245) [#2243](https://github.com/ionic-team/capacitor/issues/2243)
* docs(readme): update for 2020 (#2341) ([2e24d8d](https://github.com/ionic-team/capacitor/commit/2e24d8d)), closes [#2341](https://github.com/ionic-team/capacitor/issues/2341)


### Chores

* chore(cli): add interface for new plugin answers and use arrow function for input validation (#2286) ([0d2826e](https://github.com/ionic-team/capacitor/commit/0d2826e)), closes [#2286](https://github.com/ionic-team/capacitor/issues/2286)



## [1.4.0](https://github.com/ionic-team/capacitor/compare/1.3.0...1.4.0) (2019-12-12)


Expand Down
4 changes: 2 additions & 2 deletions Capacitor.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Capacitor'
s.version = '1.4.0'
s.version = '1.5.0'
s.summary = 'Capacitor for iOS'
s.social_media_url = 'http://twitter.com/getcapacitor'
s.license = 'MIT'
Expand All @@ -9,6 +9,6 @@ Pod::Spec.new do |s|
s.authors = { 'Ionic Team' => 'hi@ionicframework.com' }
s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s }
s.source_files = 'ios/Capacitor/Capacitor/*.{swift,h,m}', 'ios/Capacitor/Capacitor/Plugins/*.{swift,h,m}', 'ios/Capacitor/Capacitor/Plugins/**/*.{swift,h,m}'
s.dependency 'CapacitorCordova', '1.4.0'
s.dependency 'CapacitorCordova', '1.5.0'
s.swift_version = '4.2'
end
2 changes: 1 addition & 1 deletion CapacitorCordova.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "CapacitorCordova"
s.module_name = 'Cordova'
s.version = '1.4.0'
s.version = '1.5.0'
s.summary = "Capacitor Cordova Compatibility Layer"
s.homepage = "https://ionic-team.github.io/capacitor"
s.license = 'MIT'
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@

Capacitor is a cross-platform API and code execution layer that makes it easy to call Native SDKs from web code and to write custom Native plugins that your app might need. Additionally, Capacitor provides first-class Progressive Web App support so you can write one app and deploy it to the app stores, _and_ the mobile web.

Capacitor is being designed by the Ionic Framework team as an eventual alternative to Cordova, though backwards compatibility with Cordova plugins is a priority and is actively being worked on. Capacitor can be used without Ionic Framework, but soon it'll become a core part of the Ionic developer experience.
Capacitor was created by the Ionic Framework team as a spiritual successor to Cordova, though it does have backward compatibility with the majority of Cordova plugins. Capacitor can be used without [Ionic Framework](https://ionicframework.com/docs/components), but since it's a core part of the Ionic Platform, it's recommended for the best app development experience.

Capacitor also comes with a Plugin API for building native plugins. On iOS, first-class Swift support is available, and much of the iOS Capacitor runtime is written in Swift. Plugins may also be written in Objective-C. On Android, support for writing plugins with Java and Kotlin is supported.
Capacitor also comes with a Plugin API for building native plugins. On iOS, first-class Swift support is available, and much of the iOS Capacitor runtime is written in Swift. Plugins may also be written in Objective-C. On Android, writing plugins in Java and Kotlin is supported.

## Roadmap

_Disclaimer: Our roadmap is subject to change at any time and has no specific date guarantees_

2020 and beyond: The core Capacitor project is now stable. Maintenance is ongoing (including support for new mobile operating system versions, bugs, etc.). Going forward, most new functionality will be implemented as plugins. For the latest updates, track new releases [here](https://github.com/ionic-team/capacitor/releases) or milestones [here](https://github.com/ionic-team/capacitor/milestones).

[2019](https://blog.ionicframework.com/capacitor-in-2019-native-progressive-web-apps-for-all/)

2018

- __Cordova Plugin Integration__
- Preliminary support for using plugins from the existing Cordova community
- __Native Shell Add-ons__
- Support for interacting with Native UI shell elements, such as native menus, tabs, and navigation, with 1-1 fallbacks to the web for first-class Progressive Web App and Electron support.
- __Electron support__
- Support for building Electron apps and interacting with Node.js libraries
- __Enterprise Premium Plugins__
Expand Down
4 changes: 2 additions & 2 deletions android-template/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "com.getcapacitor.app"
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
5 changes: 0 additions & 5 deletions android-template/app/src/main/res/drawable/launch_splash.xml

This file was deleted.

4 changes: 2 additions & 2 deletions android-template/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion android-template/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
9 changes: 4 additions & 5 deletions android/capacitor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.novoda:bintray-release:0.9.1'
}
}
Expand All @@ -15,10 +15,10 @@ apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -47,6 +47,7 @@ dependencies {
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand All @@ -68,5 +69,3 @@ publish {
desc = 'Capacitor Android Runtime'
website = 'https://github.com/ionic-team/capacitor'
}


9 changes: 9 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,15 @@ public void onStop() {
}
}

/**
* Handle onDestroy lifecycle event and notify the plugins
*/
public void onDestroy() {
for (PluginHandle plugin : plugins.values()) {
plugin.getInstance().handleOnDestroy();
}
}

public void onBackPressed() {
PluginHandle appHandle = getPlugin("App");
if (appHandle != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public void onStop() {
@Override
public void onDestroy() {
super.onDestroy();
this.bridge.onDestroy();
if (this.mockWebView != null) {
mockWebView.handleDestroy();
}
Expand Down
9 changes: 7 additions & 2 deletions android/capacitor/src/main/java/com/getcapacitor/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void pluginRequestPermission(String permission, int requestCode) {
*/
private void addEventListener(String eventName, PluginCall call) {
List<PluginCall> listeners = eventListeners.get(eventName);
if (listeners == null) {
if (listeners == null || listeners.isEmpty()) {
listeners = new ArrayList<PluginCall>();
eventListeners.put(eventName, listeners);

Expand Down Expand Up @@ -335,7 +335,7 @@ private void removeEventListener(String eventName, PluginCall call) {
protected void notifyListeners(String eventName, JSObject data, boolean retainUntilConsumed) {
Log.v(getLogTag(), "Notifying listeners for event " + eventName);
List<PluginCall> listeners = eventListeners.get(eventName);
if (listeners == null) {
if (listeners == null || listeners.isEmpty()) {
Log.d(getLogTag(), "No listeners found for event " + eventName);
if (retainUntilConsumed) {
retainedEventArguments.put(eventName, data);
Expand Down Expand Up @@ -532,6 +532,11 @@ protected void handleOnPause() {}
*/
protected void handleOnStop() {}

/**
* Handle onDestroy
*/
protected void handleOnDestroy() {}

/**
* Start a new Activity.
*
Expand Down
8 changes: 8 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/Splash.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface SplashListener {
public static final int DEFAULT_FADE_OUT_DURATION = 200;
public static final int DEFAULT_SHOW_DURATION = 3000;
public static final boolean DEFAULT_AUTO_HIDE = true;
public static final boolean DEFAULT_SPLASH_FULL_SCREEN = false;

private static ImageView splashImage;
private static ProgressBar spinnerBar;
Expand All @@ -52,7 +53,14 @@ private static void buildViews(Context c) {
}

splashImage = new ImageView(c);

// Hide status bar during splash screen.
Boolean splashFullScreen = Config.getBoolean(CONFIG_KEY_PREFIX + "splashFullScreen", DEFAULT_SPLASH_FULL_SCREEN);
if(splashFullScreen){
splashImage.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}


// Stops flickers dead in their tracks
// https://stackoverflow.com/a/21847579/32140
splashImage.setDrawingCacheEnabled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class Browser extends Plugin {

private CustomTabsClient customTabsClient;
private CustomTabsSession currentSession;
private boolean fireFinished = false;

@PluginMethod()
public void open(PluginCall call) {
Expand Down Expand Up @@ -117,6 +118,9 @@ public void load() {
}

protected void handleOnResume() {
if (fireFinished) {
notifyListeners("browserFinished", new JSObject());
}
boolean ok = CustomTabsClient.bindCustomTabsService(getContext(), CUSTOM_TAB_PACKAGE_NAME, connection);
if (!ok) {
Log.e(getLogTag(), "Error binding to custom tabs service");
Expand All @@ -140,6 +144,12 @@ public void onNavigationEvent(int navigationEvent, Bundle extras) {
case NAVIGATION_FINISHED:
notifyListeners("browserPageLoaded", new JSObject());
break;
case TAB_HIDDEN:
fireFinished = true;
break;
case TAB_SHOWN:
fireFinished = false;
break;
}
}
});
Expand Down
Loading

0 comments on commit de72bcd

Please sign in to comment.