现在我在iOS 11.3上测试PWA,我使用下面的manifest.json文件:
{
"name": "Maplat PWA Sample",
"short_name": "Maplat PWA",
"background_color": "#fc980c",
"icons": [{
"src": "/Maplat/pwa/icon-96.png",
"sizes": "96x96",
"type": "image/png"
},{
"src": "/Maplat/pwa/icon-144.png",
"sizes": "144x144",
"type": "image/png"
},{
"src": "/Maplat/pwa/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},{
"src": "/Maplat/pwa/icon-256.png",
"sizes": "256x256",
"type": "image/png"
}],
"start_url": "/Maplat/debug.html?overlay=true",
"display": "standalone"
}
Run Code Online (Sandbox Code Playgroud)
除图标设置外,这很有效.在iPhoneX上的iOS 11.3中,图标文件不会显示在主屏幕上,但屏幕截图用作启动按钮.
我将我的清单与其他网站进行了比较,例如https://www.ft.com/或https://r.nikkei.com/,但我在图标设置中找不到任何差异.这些网站的图标适用于iOS 11.3上的PWA.
我的manifest.json有什么问题?
PS我的manifest.json适用于Android Chrome.
我想通过 vite 创建多个库,所以我首先尝试“rollupOptions”。喜欢,
import { defineConfig } from 'vite'
export default defineConfig({
build: {
rollupOptions: {
input: {
"qy-viewer": 'src/qy-viewer.ts',
"qy-swiper": 'src/qy-swiper.ts'
}
}
}
})
Run Code Online (Sandbox Code Playgroud)
但这会产生有趣的结果,包括类似散列的字符串,例如qy-swiper.f3fc032d.js
.
这是没有用的,所以我放弃了这个方法。
接下来我尝试准备多个 vite 配置文件。喜欢,
vite.qy-swiper.config.ts
import { defineConfig } from 'vite'
export default defineConfig({
build: {
lib: {
entry: 'src/qy-swiper.ts',
name: 'QySwiper',
fileName: (format) => `qy-swiper.${format}.js`
},
rollupOptions: {
}
}
})
Run Code Online (Sandbox Code Playgroud)
vite.qy-viewer.config.ts
import { defineConfig } from 'vite'
export default defineConfig({
build: {
lib: {
entry: 'src/qy-viewer.ts',
name: 'QyViewer',
fileName: …
Run Code Online (Sandbox Code Playgroud) 我现在正在测试PWA应用程序.
在Android中,它运作良好.即使在获得背景后,PWA应用程序仍保持状态,用户可以继续体验.
但是在iOS中,每次PWA应用程序运行后,它都会被初始化,并且每个条件都会像重新加载一样被粉碎.用户体验终止.
我怎样才能在iOS中阻止这种情况?
众所周知,API Gateway和lambda支持二进制请求/响应,但我对节点JavaScript中的后端编程有一个疑问.
环境:
在上述环境中,在我的代码中,我将响应内容作为二进制(缓冲对象数组).
但是,如果我直接将Buffer对象数组作为响应,
callback(null,{
headers: {'Content-Type': 'image/jpeg'},
body: body
});
Run Code Online (Sandbox Code Playgroud)
收到回复是这样的:
Content-type: image/jpeg
{type=Buffer, data=[255,216,255,224,0,16,74,70,73,70,0...
Run Code Online (Sandbox Code Playgroud)
如果我通过base64编码将Buffer对象数组作为响应,
callback(null,{
headers: {'Content-Type': 'image/jpeg'},
body: body.toString('base64')
});
Run Code Online (Sandbox Code Playgroud)
收到回复是这样的:
Content-type: image/jpeg
/9j/4AAQSkZJRgABAQEASABIAAD/2wBDA...
Run Code Online (Sandbox Code Playgroud)
如何使用无服务器框架从节点JS后端向API网关提供二进制响应?
== PostScript ==
根据此文档:
没有Accept标头的AWS API Gateway二进制输出
我们必须将Integration响应的"Content Handling"更改为"CONVERT TO BINARY",以响应二进制响应.
但是我该怎么设置呢?
我不知道serverless.yml和AWS控制台GUI.
如果我成功设置了Content Handling => CONVERT TO BINARY,我可以解决响应二进制响应吗?
== 1月17日编辑==
嗨@ ka-hou-ieong
你写了rest-api-id和resource-id,它们在下面的图片中,对吗?
但是使用这些id,命令结果说:
$aws apigateway put-integration-response --rest-api-id XXXXXXXX --resource-id XXXXXX --http-method GET --status-code 200 --content-handling CONVERT_TO_BINARY
An error occurred …
Run Code Online (Sandbox Code Playgroud) 我想在docker容器中挂载s3fs.
我用s3fs制作了docker图像,并且这样做:
host$ docker run -it --rm docker/s3fs bash
[ root@container:~ ]$ s3fs s3bucket /mnt/s3bucket -o allow_other -o allow_other,default_acl=public-read -ouse_cache=/tmp
fuse: failed to open /dev/fuse: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
显示"不允许操作"错误.
所以我用谷歌搜索,并做了这样(再次添加--privileged = true):
host$ docker run -it --rm --privileged=true docker/s3fs bash
[ root@container:~ ]$ s3fs s3bucket /mnt/s3bucket -o allow_other -o allow_other,default_acl=public-read -ouse_cache=/tmp
[ root@container:~ ]$ ls /mnt/s3bucket
ls: cannot access /mnt/s3bucket: Transport endpoint is not connected
[ root@container:~ ]$ fusermount -u /mnt/s3bucket
[ root@container:~ ]$ s3fs s3bucket /mnt/s3bucket -o allow_other -o …
Run Code Online (Sandbox Code Playgroud) 我想通过 vite 获取 npm 模块中的 css 原始字符串。根据vite手册,
https://vitejs.dev/guide/assets.html#importing-asset-as-string
它说我们可以通过在标识符末尾添加“?raw”来获取原始字符串。
所以我尝试这个:
从“swiper/css/bundle?raw”导入样式;
但这显示错误,例如:
[vite] 内部服务器错误:“swiper”包中缺少“./css/bundle?raw”导出
如果我使用这个:
从“swiper/css/bundle”导入样式;
没有错误,但 css 不只是作为字符串加载,而是作为捆绑 css 处理。
这不好,因为我想在我的基于 lit 的 Web 组件中使用这个 css。
有没有办法通过vite获取css作为原始字符串?
什么是Cesium(https://cesiumjs.org/)的高度值是什么意思?Ellipsoid的海拔高度值?或者,海拔高度?
注:海拔高度与海拔高度的差异为,[海拔] = [海平面以上] + [大地水准面值]
我想要做的是将Cesium的相机设置为从智能手机的GPS获得的真实GPS值的相同位置,但GPS的高度值是海拔高度,因此如果铯使用海拔高度作为其高度参考,则相机的位置设置为太高的位置. ..
谁知道这个?
我想研究如何绑定iOS库与处理指向Xamarin.iOS的指针.它需要编组.
我准备这样的库进行测试,
MarshalTest.h
typedef struct
{
float x,y,z;
} Marshal3D;
@interface MarshalTest : NSObject
-(id)initWithMarshal:(Marshal3D *)marshal;
-(id)initWithMarshals:(Marshal3D *)marshals num:(int)numCoord;
-(void)addMarshal:(Marshal3D *)marshal;
-(void)addMarshals:(Marshal3D *)marshals num:(int)numCoord;
-(int)getMarshals:(Marshal3D **)getMarshals;
-(int) storedNumber;
-(float)checkMarshalValue:(int)index xyz:(int)xyz;
@end
Run Code Online (Sandbox Code Playgroud)
并准备绑定c#代码,如下所示:
StructsAndEnums.cs
using System;
using System.Runtime.InteropServices;
namespace MarshalTestNet
{
[StructLayout(LayoutKind.Sequential)]
public struct Marshal3D
{
public float x;
public float y;
public float z;
};
}
Run Code Online (Sandbox Code Playgroud)
ApiDefinition.cs
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using MonoTouch.ObjCRuntime;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MarshalTestNet
{
[BaseType (typeof (NSObject))]
public partial interface MarshalTest { …
Run Code Online (Sandbox Code Playgroud) 我做了一个UIViewController像
public class MyViewController : UIViewController
{
...
public override bool ShouldAutorotate ()
{
return true;
}
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()
{
return UIInterfaceOrientationMask.AllButUpsideDown;
}
}
Run Code Online (Sandbox Code Playgroud)
并在AppDelegate.cs中使用它。
Window.RootViewController = new MyViewController();
Run Code Online (Sandbox Code Playgroud)
当我运行这段代码时,“ ShouldAutorotate”和“ GetSupportedInterfaceOrientations”在视图初始化阶段被多次调用,但是在显示应用程序视图之后,它们再也不会调用。
我检查了Info.plist中的方向设置是否有效。iOS SDK目标为7.1,Xamarin Studio版本为5.0.1(内部版本3),Xamarin.iOS版本为7.2.3.39。
有任何想法吗?
我创建了2个PWA网站
https://s.maplat.jp/r/naramap和https://s.maplat.jp/r/aizumap
但是这些不能一起安装在主屏幕上。
一旦安装了一个,另一个将无法安装。
在同一域上安装PWA是否有任何规范或限制?
ios ×2
vite ×2
xamarin ×2
xamarin.ios ×2
aws-lambda ×1
build ×1
c# ×1
cesium ×1
css ×1
docker ×1
fuse ×1
gis ×1
import ×1
javascript ×1
lit ×1
marshalling ×1
rotation ×1
s3fs ×1
typescript ×1