Skip to content

Commit

Permalink
feat: 支持打包成APP(Android iOS)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttop5 committed Aug 7, 2019
1 parent 0cb5470 commit 8e03b2b
Show file tree
Hide file tree
Showing 8 changed files with 727 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@

#### Chrome 插件

如果您的网络无法访问 Chrome 商店,您也可以从 [这里](https://github.com/ttop5/to-be-slack/releases) 下载最新的 `to-be-slack.crx` 文件
您可以直接点击[这里](https://chrome.google.com/webstore/detail/%E4%BB%8A%E6%97%A5%E7%83%AD%E6%A6%9C/ldmhioaifhbepgelhgcjkpfjlhmcjmmd)进行安装。如果您的网络无法访问 Chrome 商店,您也可以从 [这里](https://github.com/ttop5/to-be-slack/releases) 下载最新的 `to-be-slack.crx` 文件,

然后打开 Chrome 浏览器地址栏输入 chrome://extensions ,打开 `开发者模式`,把下载好的文件拖拽到此界面,点击 `添加拓展程序` 来完成安装。

![屏幕快照 2019-08-03 12 28 07](https://user-images.githubusercontent.com/9512362/62407411-c72b7700-b5ea-11e9-8600-25f785047af0.png)

#### PWA

移动端推荐使用 PWA 程序,使用效果最佳。因为有了这个好东西,所以暂时懒得打包成 APP 了。
移动端推荐使用 PWA 程序,使用效果最佳且简单方便。~~因为有了这个好东西,所以暂时懒得打包成 APP 了~~ 现已支持打包成 Android 和 iOS 程序,如有需要可自行打包使用

iOS:使用 Safari 打开 [https://ttop5.github.io/to-be-slack](https://ttop5.github.io/to-be-slack) -> 正下方中间分享按钮 -> 添加到主屏幕;
iOS:使用 `Safari` 打开 [https://ttop5.github.io/to-be-slack](https://ttop5.github.io/to-be-slack) -> 正下方中间分享按钮 -> 添加到主屏幕;

Android:使用 Chrome 打开 [https://ttop5.github.io/to-be-slack](https://ttop5.github.io/to-be-slack) -> 右上角菜单 -> 添加到主屏幕;
Android:使用 `Chrome` 打开 [https://ttop5.github.io/to-be-slack](https://ttop5.github.io/to-be-slack) -> 右上角菜单 -> 添加到主屏幕;如果不成功,请确认 Chrome 有添加桌面快捷方式的权限。

操作完成后手机主屏幕就会多出一个今日热榜的程序啦!

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ToBeSlack",
"version": "1.3.1",
"version": "1.4.0",
"description": "摸鱼愉快",
"productName": "今日热榜",
"cordovaId": "org.cordova.quasar.app",
Expand All @@ -10,8 +10,12 @@
"lint": "eslint --ext .js,.vue src",
"dev": "quasar dev",
"dev-pwa": "quasar dev -m pwa",
"dev-android": "quasar dev -m android",
"dev-ios": "quasar dev -m ios",
"build": "quasar build && cp src-ext/background.html ./dist/spa && cp src-ext/manifest.json ./dist/spa",
"build-pwa": "quasar build -m pwa",
"build-android": "quasar build -m android",
"build-ios": "quasar build -m ios",
"deploy": "yarn build-pwa && node publish.js",
"test": "echo \"No test specified\" && exit 0"
},
Expand Down
24 changes: 24 additions & 0 deletions src-cordova/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.cordova.quasar.app" version="1.4.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>今日热榜</name>
<description>摸鱼愉快</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
23 changes: 23 additions & 0 deletions src-cordova/hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova Hooks

Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide.
Loading

0 comments on commit 8e03b2b

Please sign in to comment.