我一直在努力让Cordova工作并在我的iPhone上运行.我按照下面的命令,但在构建时看到以下错误:
cordova create myApp org.apache.cordova.myApp myApp
cd myApp
cordova platform add ios
cordova build ios
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Building project: /Users/ben/Desktop/myTest/platforms/ios/myTest.xcworkspace
Configuration: Debug
Platform: device
User defaults from command line:
IDEArchivePathOverride = /Users/ben/Desktop/myTest/platforms/ios/myTest.xcarchive
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/ben/Desktop/myTest/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/ben/Desktop/myTest/platforms/ios/build/sharedpch
Build settings from configuration file '/Users/ben/Desktop/myTest/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
error: archive not found …Run Code Online (Sandbox Code Playgroud) 我正在尝试处理启动选项并在点击我在swift 3中收到的远程通知时打开一个特定的视图控制器.我已经看到类似的问题,例如这里,但没有新的swift 3实现.我看到了一个类似的问题(和)在AppDelegate.swift中我在didFinishLaunchingWithOptions中有以下内容:
var localNotif = (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] as! String)
if localNotif {
var itemName = (localNotif.userInfo!["aps"] as! String)
print("Custom: \(itemName)")
}
else {
print("//////////////////////////")
}
Run Code Online (Sandbox Code Playgroud)
但是Xcode给了我这个错误:
Type '[NSObject: AnyObject]?' has no subscript members
Run Code Online (Sandbox Code Playgroud)
我也试过这个:
if let launchOptions = launchOptions {
var notificationPayload: NSDictionary = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] as NSDictionary!
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
error: ambiguous reference to member 'subscript'
Run Code Online (Sandbox Code Playgroud)
我有类似的错误,无论我以前使用类似的代码通过键从字典中获取值,我不得不替换代码,基本上安全地首先解开字典.但这似乎不适用于此.任何帮助,将不胜感激.谢谢.
ios firebase swift firebase-cloud-messaging firebase-notifications
我正在尝试将我的Firebase库升级到新的9.4.0版本; 但是,我在同步时得到Gradle中的"无法解决"错误.这是错误:
Error:(38, 13) Failed to resolve: com.google.firebase:firebase-core:9.4.0
Error:(40, 13) Failed to resolve: com.google.firebase:firebase-auth:9.4.0
Error:(40, 13) Failed to resolve: com.google.firebase:firebase-storage:9.4.0
Run Code Online (Sandbox Code Playgroud)
尝试与没有firebase核心,没有区别.
这是应用程序和项目级别的Gradle:项目级别:
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
对于模块:app level:apply plugin:'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig …Run Code Online (Sandbox Code Playgroud) 我已成功测试Firebase功能以进行存储.但是,我没有看到任何提示如何仅在将文件添加到我的存储桶中的文件夹时调用该函数.我已经看到了关于划定范围的功能,唯一的暗示是不同的桶在这里.
是否可以将功能范围扩展到我的存储桶中的文件夹,如果是,如何?或者我需要多个存储桶而不是文件夹来分隔不同的任务.
google-cloud-storage firebase google-cloud-functions firebase-storage
预期行为:我假设当文档的某个字段被修改时,查询只会返回该文档,因此它只会被视为 1 次读取。假设我查询一个包含 n 个文档的集合,我希望它的初始状态为 n 次读取,如果稍后修改文档,则只会从数据库中再次读取该文档,从而总共读取 n+1 次。
我看到的 是最初读取 n 次,每当修改一个文档时 n 次读取,无论是否启用离线持久性;导致 2n 次读取所有“ fromCache : false ”元数据。
myCollection:
doc1 :
value: "some string"
...
docn:
value: "some text"
Run Code Online (Sandbox Code Playgroud)
后来我通过控制台更改了一个文档的值:
myCollection:
doc1 :
value: "changed to other value"
...
docn:
value: "some text"
Run Code Online (Sandbox Code Playgroud)
但是我在查询的快照中再次获得了所有 n 个文档。尽管我可以使用“s.docChanges”观察更改,但快照似乎包含所有 n 个文档。
const someCollectionRef = firebase.firestore().collection("collection/document/subdocl??lection");
someCollectionRef.onSnapshot(s => {
var d = [];
s.forEach(doc => {
d.push(doc.data()));
//fromCache is always false even when one document is …Run Code Online (Sandbox Code Playgroud) 我有点困惑的是,像下面这样的查询是计为一次读取还是25次读取Firestore定价?
queryRef.limit(25).get().then(()=>{
...
});
Run Code Online (Sandbox Code Playgroud)
据我所知,在定价图表中,"文档读取"已被定义为单元,但我对上述查询有点困惑,需要确认.
Firestore 文档和配额图表显示,文档只能大约每秒更新一次。为什么我似乎每秒可以多次更新文档而没有问题?
我尝试了一个简单的“ for循环”,所有写入似乎都通过了:
const db = firebase.firestore(firebase.app("prjID"));
for (i = 0; i < 10; i++) {
console.log(`updating /test/test with test:${i} ${new Date().getMilliseconds()}`);
db.doc(`/test/test`).update({ test: i });
}
Run Code Online (Sandbox Code Playgroud)
我想知道有人在不到一秒钟的时间内尝试多次写操作(即超出我似乎可以忽略的限制)时是否知道服务器的响应?
如果我遗漏了某些东西,而极限值意味着有些不同的解释?
我有 apache Cordova 和 iOS 平台的问题。我被困在 Cordova 构建中,除了下面的消息之外什么也没有发生。
Cordova 构建 iOS --verbose :
No scripts found for hook "before_compile".
PlatformApi successfully found for platform ios
Building for iPhone X Simulator
Building project: /Users/ben/Desktop/myApp/platforms/ios/myApp.xcworkspace
Configuration: Debug
Platform: emulator
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/ben/Desktop/myApp/platforms/ios/build/emulator
SDKROOT = iphonesimulator12.0
SHARED_PRECOMPS_DIR = /Users/ben/Desktop/myApp/platforms/ios/build/sharedpch
Build settings from configuration file '/Users/ben/Desktop/myApp/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
OTHER_LDFLAGS …Run Code Online (Sandbox Code Playgroud) 我有一个 UIView 正在添加到 UIViewController 并且通常正在测试取消初始化以确保我做对了。但是当我没有将 viewController 中的变量设置为 nil 并且只使用 .removeFromSuperView() 时,UIView 中的 deinit() 方法不会被调用,直到我再次添加 UIView 然后调用它。但是,如果我使用 removeFromSuperView() 并将变量设置为 nil,则会立即调用 deinit()。这是为什么?
这是 UIView() 类:
class TestView: UIView {
override init(frame: CGRect) {
super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
print("init is happneing")
}
deinit {
print("de init is happneing")
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Run Code Online (Sandbox Code Playgroud)
这是父 ViewController :
class MyViewController: UIViewController {
var tstview : TestView?
//adding the UIView by tapping on …Run Code Online (Sandbox Code Playgroud) 有没有办法让Firebase命令行简单地刷新服务器,因为我将更改应用于类似于nodemon对nodeJS的代码?我正在使用Polymer for web.
firebase nodemon firebase-hosting firebase-polymer firebase-tools