Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit b3a92b2 Merge: 919b855 6df5efe Author: Grgur Grisogono <grgur@grgur.com> Date: Wed Jan 30 16:40:20 2019 +0100 Merge branch 'master' into GI#94-ask-app-review # Conflicts: # ios/App/App.xcodeproj/project.pbxproj # ios/App/Podfile.lock # package-lock.json # package.json commit 919b855 Merge: a9482dc 2a276ff Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Wed Jan 23 11:28:31 2019 -0600 Merge branch 'master' into GI#94-ask-app-review commit a9482dc Merge: 38708a4 44fdbbc Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Wed Jan 23 11:14:20 2019 -0600 Merge branch 'master' into GI#94-ask-app-review commit 38708a4 Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Sun Oct 21 17:11:15 2018 -0600 Changes after feedback and changes requested by marketing team commit 0e7961e Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Thu Oct 4 08:47:08 2018 -0600 Updating contact email and enabling feeback email on web environments commit f29fda6 Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Tue Oct 2 16:40:14 2018 -0600 Changes to use fullscreen modal on reviews and also support feedback via email commit d2531b7 Merge: c907e89 5af0dc7 Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Tue Oct 2 12:52:21 2018 -0600 Merge branch 'master' into GI#94-ask-app-review commit c907e89 Merge: d1e277f cd9212d Author: Grgur Grisogono <grgur@grgur.com> Date: Mon Oct 1 14:31:44 2018 +0200 Merge branch 'master' into GI#94-ask-app-review commit d1e277f Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Fri Sep 28 14:12:21 2018 -0400 Updating native platforms projects changes according cordova-plugin-market dependency commit 3214978 Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Fri Sep 28 14:07:35 2018 -0400 Updating native platforms projects changes according cordova-plugin-market dependency commit 577a6b2 Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Fri Sep 21 20:08:46 2018 -0600 Removing NativeStorage cordova dependency and changes after code review commit cd60846 Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Wed Sep 19 15:01:16 2018 -0600 Removing not needed dependencies commit f0b8012 Author: elninjagaiden <diego.garcia.segura@gmail.com> Date: Wed Sep 19 14:10:41 2018 -0600 Service to support app reviews on apps stores
- Loading branch information
Showing
30 changed files
with
9,789 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> | ||
|
||
<feature name="Market"> | ||
<param name="android-package" value="com.xmartlabs.cordova.market.Market"/> | ||
</feature> | ||
|
||
</widget> |
95 changes: 95 additions & 0 deletions
95
.../capacitor-cordova-android-plugins/src/main/java/com/xmartlabs/cordova/market/Market.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package com.xmartlabs.cordova.market; | ||
|
||
import org.apache.cordova.CordovaWebView; | ||
import org.apache.cordova.CallbackContext; | ||
import org.apache.cordova.CordovaPlugin; | ||
import org.apache.cordova.CordovaInterface; | ||
|
||
import org.json.JSONArray; | ||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
import android.content.Context; | ||
import android.content.ComponentName; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.util.Log; | ||
|
||
/** | ||
* Interact with Google Play. | ||
* | ||
* @author Miguel Revetria <miguel@xmartlabs.com> | ||
* @license Apache 2.0 | ||
*/ | ||
public class Market extends CordovaPlugin | ||
{ | ||
/** | ||
* Executes the request and returns PluginResult. | ||
* | ||
* @param action | ||
* Action to perform. | ||
* @param args | ||
* Arguments to the action. | ||
* @param callbackId | ||
* JavaScript callback ID. | ||
* @return A PluginResult object with a status and message. | ||
*/ | ||
@Override | ||
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { | ||
try { | ||
if (action.equals("open")) { | ||
if (args.length() == 1) { | ||
String appId = args.getString(0); | ||
this.openGooglePlay(appId); | ||
|
||
callbackContext.success(); | ||
return true; | ||
} | ||
}else if (action.equals("search")) { | ||
if (args.length() == 1) { | ||
String key = args.getString(0); | ||
this.searchGooglePlay(key); | ||
|
||
callbackContext.success(); | ||
return true; | ||
} | ||
} | ||
} catch (JSONException e) { | ||
Log.d("CordovaLog","Plugin Market: cannot parse args."); | ||
e.printStackTrace(); | ||
} catch (android.content.ActivityNotFoundException e) { | ||
Log.d("CordovaLog","Plugin Market: cannot open Google Play activity."); | ||
e.printStackTrace(); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
/** | ||
* Open the appId details on Google Play . | ||
* | ||
* @param appId | ||
* Application Id on Google Play. | ||
* E.g.: com.google.earth | ||
*/ | ||
private void openGooglePlay(String appId) throws android.content.ActivityNotFoundException { | ||
Context context = this.cordova.getActivity().getApplicationContext(); | ||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appId)); | ||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
context.startActivity(intent); | ||
} | ||
|
||
/** | ||
* search the details on Google Play . | ||
* | ||
* @param searchKeyword | ||
* Application Id on Google Play. | ||
* E.g.: earth | ||
*/ | ||
private void searchGooglePlay(String key) throws android.content.ActivityNotFoundException { | ||
Context context = this.cordova.getActivity().getApplicationContext(); | ||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=" + key)); | ||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
context.startActivity(intent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> | ||
|
||
<feature name="Market"> | ||
<param name="ios-package" value="CDVMarket"/> | ||
</feature> | ||
|
||
</widget> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'CordovaPlugins' | ||
s.version = '1.0.0-beta.11' | ||
s.summary = 'Autogenerated spec' | ||
s.license = 'Unknown' | ||
s.homepage = 'https://example.com' | ||
s.authors = { 'Capacitor Generator' => 'hi@example.com' } | ||
s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '1.0.0-beta.11' } | ||
s.source_files = 'sources/**/*.{swift,h,m,c,cc,mm,cpp}' | ||
s.ios.deployment_target = '11.0' | ||
s.dependency 'CapacitorCordova' | ||
s.swift_version = '4.0' | ||
|
||
end |
11 changes: 11 additions & 0 deletions
11
ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'CordovaPluginsResources' | ||
s.version = '0.0.105' | ||
s.summary = 'Resources for Cordova plugins' | ||
s.social_media_url = 'http://twitter.com/getcapacitor' | ||
s.license = 'MIT' | ||
s.homepage = 'https://capacitor.ionicframework.com/' | ||
s.authors = { 'Ionic Team' => 'hi@ionicframework.com' } | ||
s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s } | ||
s.resources = ['resources/*'] | ||
end |
15 changes: 15 additions & 0 deletions
15
ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'CordovaPluginsStatic' | ||
s.version = '1.0.0-beta.11' | ||
s.summary = 'Autogenerated spec' | ||
s.license = 'Unknown' | ||
s.homepage = 'https://example.com' | ||
s.authors = { 'Capacitor Generator' => 'hi@example.com' } | ||
s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '1.0.0-beta.11' } | ||
s.source_files = 'sourcesstatic/**/*.{swift,h,m,c,cc,mm,cpp}' | ||
s.ios.deployment_target = '11.0' | ||
s.dependency 'CapacitorCordova' | ||
s.swift_version = '4.0' | ||
s.static_framework = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
14 changes: 14 additions & 0 deletions
14
ios/capacitor-cordova-ios-plugins/sources/CordovaPluginMarket/CDVMarket.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// CDVMarket.h | ||
// | ||
// Created by Miguel Revetria miguel@xmartlabs.com on 2014-03-17. | ||
// License Apache 2.0 | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <Cordova/CDVPlugin.h> | ||
|
||
@interface CDVMarket : CDVPlugin | ||
|
||
- (void)open:(CDVInvokedUrlCommand *)command; | ||
|
||
@end |
35 changes: 35 additions & 0 deletions
35
ios/capacitor-cordova-ios-plugins/sources/CordovaPluginMarket/CDVMarket.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// CDVMarket.h | ||
// | ||
// Created by Miguel Revetria miguel@xmartlabs.com on 2014-03-17. | ||
// License Apache 2.0 | ||
|
||
#include "CDVMarket.h" | ||
|
||
@implementation CDVMarket | ||
|
||
- (void)pluginInitialize | ||
{ | ||
} | ||
|
||
- (void)open:(CDVInvokedUrlCommand *)command | ||
{ | ||
[self.commandDelegate runInBackground:^{ | ||
NSArray *args = command.arguments; | ||
NSString *appId = [args objectAtIndex:0]; | ||
|
||
CDVPluginResult *pluginResult; | ||
if (appId) { | ||
NSString *url = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/%@", appId]; | ||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; | ||
|
||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; | ||
} else { | ||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid application id: null was found"]; | ||
} | ||
|
||
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; | ||
}]; | ||
} | ||
|
||
@end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { version as appVersion } from '../package.json' | ||
import { Plugins } from '@capacitor/core' | ||
const { Storage } = Plugins | ||
const lastMajorAppVersionStorageKey = 'lastMajorAppVersion' | ||
|
||
export default { | ||
currentMajorAppVersion: 0, | ||
lastMajorAppVersion: 0, | ||
isMajorUpdate: false, | ||
async init() { | ||
this.currentMajorAppVersion = this.getCurrentAppMajorVersion() | ||
this.lastMajorAppVersion = await this.getLastAppMajorVersion() | ||
this.isMajorUpdate = this.currentMajorAppVersion > this.lastMajorAppVersion | ||
if (this.isMajorUpdate || this.currentMajorAppVersion === 0) { | ||
Storage.set({ | ||
key: lastMajorAppVersionStorageKey, | ||
value: this.currentMajorAppVersion.toString(), | ||
}) | ||
} | ||
}, | ||
getCurrentAppMajorVersion() { | ||
return parseInt(appVersion.split('.')[0]) | ||
}, | ||
async getLastAppMajorVersion() { | ||
const lastMajorAppVersionData = await Storage.get({ key: lastMajorAppVersionStorageKey }) | ||
if (lastMajorAppVersionData && lastMajorAppVersionData.value) { | ||
return parseInt(lastMajorAppVersionData.value) | ||
} | ||
return 0 | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.