Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
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
grgur committed Jan 30, 2019
1 parent 6df5efe commit 030d6de
Show file tree
Hide file tree
Showing 30 changed files with 9,789 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .env
Expand Up @@ -2,3 +2,7 @@ VUE_APP_NAME=BEEP
VUE_APP_INITIAL_STATUSBAR_COLOR=#FFFFFF
VUE_APP_UNSAFE_STATUSBAR_COLOR=#FF5C5D
VUE_APP_SAFE_STATUSBAR_COLOR=#47BD8F
VUE_APP_STORE_REVIEWS_ENABLED=true
VUE_APP_IOS_APP_ID = 'id1434675665'
VUE_APP_SUPPORT_EMAIL = 'contact@moduscreate.com'
VUE_APP_SUPPORT_EMAIL_SUBJECT = 'Feedback: About beep'
4 changes: 4 additions & 0 deletions android/app/src/main/res/xml/config.xml
@@ -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>
@@ -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);
}
}
2 changes: 2 additions & 0 deletions ios/App/App.xcodeproj/project.pbxproj
Expand Up @@ -225,11 +225,13 @@
"${SRCROOT}/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework",
"${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework",
"${BUILT_PRODUCTS_DIR}/CordovaPlugins/CordovaPlugins.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Capacitor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cordova.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CordovaPlugins.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
4 changes: 4 additions & 0 deletions ios/App/App/config.xml
@@ -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>
3 changes: 2 additions & 1 deletion ios/App/Podfile
Expand Up @@ -7,6 +7,7 @@ target 'App' do
# Automatic Capacitor Pod dependencies, do not delete
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'

pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'

# Do not delete
end
8 changes: 7 additions & 1 deletion ios/App/Podfile.lock
Expand Up @@ -2,21 +2,27 @@ PODS:
- Capacitor (1.0.0-beta.10):
- CapacitorCordova (= 1.0.0-beta.10)
- CapacitorCordova (1.0.0-beta.10)
- CordovaPlugins (1.0.0-beta.11):
- CapacitorCordova

DEPENDENCIES:
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
- CordovaPlugins (from `../capacitor-cordova-ios-plugins`)

EXTERNAL SOURCES:
Capacitor:
:path: "../../node_modules/@capacitor/ios"
CapacitorCordova:
:path: "../../node_modules/@capacitor/ios"
CordovaPlugins:
:path: "../capacitor-cordova-ios-plugins"

SPEC CHECKSUMS:
Capacitor: 9aa60986d00166b45b3216daf90f49f8df6593fa
CapacitorCordova: aab520b872cabe0d9f30a03dc385c5dce8d2c82b
CordovaPlugins: 3890c45090aa3bd73fbd2bbd94db322ab18ec794

PODFILE CHECKSUM: 144b255a8aae841ea14f3ee0bfb55be44afd1167
PODFILE CHECKSUM: 1bb060a01b3dd72e2ee7a4a92775c43a5a308f02

COCOAPODS: 1.5.3
15 changes: 15 additions & 0 deletions ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec
@@ -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 ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec
@@ -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 ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec
@@ -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
1 change: 1 addition & 0 deletions ios/capacitor-cordova-ios-plugins/resources/.gitkeep
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions ios/capacitor-cordova-ios-plugins/sources/.gitkeep
@@ -0,0 +1 @@

@@ -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
@@ -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
6 changes: 5 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -30,6 +30,7 @@
"@capacitor/cli": "1.0.0-beta.11",
"@capacitor/core": "1.0.0-beta.11",
"@capacitor/ios": "1.0.0-beta.11",
"cordova-plugin-market": "git+https://github.com/xmartlabs/cordova-plugin-market.git",
"@ionic/core": "4.0.0-rc.3",
"@modus/ionic-vue": "^1.2.2",
"axios": "0.18.0",
Expand Down
31 changes: 31 additions & 0 deletions src/appService.js
@@ -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
},
}
26 changes: 21 additions & 5 deletions src/components/Modal.vue
@@ -1,23 +1,23 @@
<template>
<div>
<ion-header>
<ion-toolbar>
<ion-toolbar :class="className">
<ion-buttons slot="start">
<ion-button @click="closeModal">
<ion-button @click="closeModal" :class="className">
<ion-icon size="large" name="close"/>
</ion-button>
</ion-buttons>
<ion-title>{{ title }}</ion-title>
<ion-buttons slot="end">
<ion-button clear @click="closeModal">
<ion-button clear @click="closeModal" :class="className">
Done
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-content padding :class="className">
<div class="modal-content">
<slot/>
<slot />
</div>
</ion-content>
</div>
Expand All @@ -28,6 +28,7 @@ export default {
name: 'Modal',
props: {
title: { type: String, default: '' },
className: { type: String, default: '' },
},
methods: {
closeModal() {
Expand Down Expand Up @@ -64,4 +65,19 @@ ion-button.button.button-clear.button-md.button-clear-md {
--ion-color-base: var(--beep-primary);
text-transform: none;
}
ion-toolbar.feedback-modal {
--background: var(--beep-secondary);
color: var(--beep-primary);
}
ion-content.feedback-modal {
--background: var(--beep-secondary);
text-align: center;
}
ion-back-button.feedback-modal {
color: var(--beep-primary);
}
ion-button.feedback-modal {
color: var(--beep-primary);
}
</style>

0 comments on commit 030d6de

Please sign in to comment.