我正在努力在我的角度应用程序中使用 AWS S3 Multipart 上传文件。上传开始,但在加载数据达到 12 MB 后重新开始。
日志:
Object {loaded: 12582912, total: 91015730, part: 3, key: "IMG_2973.MOV"}
postVideo.js:46 14% done
postVideo.js:47 Object {loaded: 12582912, total: 91015730, part: 4, key: "IMG_2973.MOV"}
postVideo.js:46 8% done
postVideo.js:47 Object {loaded: 7684096, total: 91015730, part: 2, key: "IMG_2973.MOV"}
postVideo.js:46 7% done
postVideo.js:47 Object {loaded: 6078464, total: 91015730, part: 4, key: "IMG_2973.MOV"}
postVideo.js:46 4% done
postVideo.js:47 Object {loaded: 3850240, total: 91015730, part: 3, key: "IMG_2973.MOV"}
postVideo.js:46 1% done
Object {loaded: 589824, total: 91015730, part: …Run Code Online (Sandbox Code Playgroud) 我目前正在开发一个带有 firebase 3.0 的 node.js 服务,该服务由使用 firebase 2.4 的 Web 应用程序调用。
我正在我的标头调用中发送当前用户Firebase ID 令牌( Auth.$getAuth().token) 并尝试使用
var idToken = req.headers["x-access-token"];
auth.verifyIdToken(idToken).then(function(decodedToken) {
var uid = decodedToken.sub;
console.log(decodedToken);
}, function(error){
console.log(error);
});
Run Code Online (Sandbox Code Playgroud)
但我得到:
[Error: Firebase Auth ID token has no "kid" claim]
Run Code Online (Sandbox Code Playgroud)
获取身份验证():
更新
我刚刚测试了在服务器端生成和验证令牌,我遇到了同样的问题。
var auth = firebase.auth();
var token = auth.createCustomToken(userId, {"premium_account": true});
console.log(token);
auth.verifyIdToken(token).then(function(decodedToken) {
console.log(decodedToken);
}, function(error){
console.log(error);
});
Run Code Online (Sandbox Code Playgroud)
有什么建议?
更新 2:[解决方案]
我的问题是使用 AngularFire 2.XX 生成的令牌与我的服务器中运行的 Firebase 3.XX 不兼容。因此,在深入了解人们在此处和此 google group 主题中写的一些想法后,解决方法是使用 …
我在打字方面遇到了一些问题.当我运行时,npm start我得到以下错误:
> tsc && concurrently "npm run tscw" "npm run lite"
node_modules/@angular/common/src/directives/ng_class.d.ts(72,35): error TS2304: Cannot find name 'Set'.
node_modules/@angular/common/src/facade/async.d.ts(27,33): error TS2304: Cannot find name 'Promise'.
node_modules/@angular/common/src/facade/async.d.ts(28,45): error TS2304: Cannot find name 'Promise'.
node_modules/@angular/common/src/facade/lang.d.ts(4,17): error TS2304: Cannot find name 'Map'.
node_modules/@angular/common/src/facade/lang.d.ts(5,17): error TS2304: Cannot find name 'Set'.
node_modules/@angular/common/src/facade/lang.d.ts(70,59): error TS2304: Cannot find name 'Map'.
node_modules/@angular/common/src/facade/promise.d.ts(2,14): error TS2304: Cannot find name 'Promise'.
node_modules/@angular/common/src/facade/promise.d.ts(8,32): error TS2304: Cannot find name 'Promise'.
node_modules/@angular/common/src/facade/promise.d.ts(9,38): error TS2304: Cannot find name 'Promise'.
node_modules/@angular/common/src/facade/promise.d.ts(10,35): error TS2304: …Run Code Online (Sandbox Code Playgroud) 我在Parse上用User和Request作为类开发应用程序.我的用户将currentLocation(PFGeoPoint)作为属性,并且Requests有一个指针来引用拥有该请求的用户(请求者:PFUser).所以我试图找到当前用户登录附近的用户的请求.
我需要做类似的事情:
let currentUserGeoPoint = PFUser.currentUser()!["currentLocation"] as! PFGeoPoint
var query = PFQuery(className:"Request")
query.whereKey("requestor.currentLocation", nearGeoPoint: currentUserGeoPoint)
query.findObjectsInBackgroundWithBlock {
(objects, error) -> Void in
if (error == nil) {
self.userRequests = objects!
self.tableView.reloadData()
}else {
println(error?.userInfo)
}
}
Run Code Online (Sandbox Code Playgroud)
但不幸的是,这是不可能的:
[Error]: Dot notation can only be used on objects (Code: 102, Version: 1.8.1)
Optional([code: 102, error: Dot notation can only be used on objects, temporary: 0, NSLocalizedDescription: Dot notation can only be used on objects])
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
这就是我的Request Class在Parse上的样子:
这是用户类:
我想在我的UITextField中添加一个带有文本"..."的按钮.我正在尝试的是以下内容:
@IBOutlet weak var requestTitleTxtField: UITextField!
Run Code Online (Sandbox Code Playgroud)
viewDidLoad中():
var detailsButton = UIButton()
detailsButton.titleLabel!.text = "..."
requestTitleTxtField.rightViewMode = UITextFieldViewMode.Always
requestTitleTxtField.rightView = detailsButton
Run Code Online (Sandbox Code Playgroud)
这不会返回任何错误消息,但也不显示按钮.
我正在使用firebase来保存包含以下数据的帖子:
createdAt: "Sun Apr 03 2016 18:32:46 GMT-0300 (BRT)"
Run Code Online (Sandbox Code Playgroud)
我想要实现的是先获取最新帖子,然后在用户向下滚动时加载旧帖子.
使用ngInfiniteScroll检索的帖子我可以使用ngInfiniteScroll来命令desc <div ng-repeat="post in posts | orderBy:'-createdAt'">,然后首先返回旧帖子.我订购但是我订的是旧的.
我已经尝试"-createdAt"在ngInfiniteScroll中使用相同的逻辑()但它没有效果.
我的js就是这样的:
var baseRef = new Firebase(FBURL).child("posts");
var scrollRef = new Firebase.util.Scroll(baseRef, "createdAt");
$scope.posts = $firebaseArray(scrollRef);
$scope.posts.scroll = scrollRef.scroll;
Run Code Online (Sandbox Code Playgroud)
安全和规则:
"posts": {
".read": true,
".indexOn": "createdAt",
"$post": {
".read": true,
".write": true,
"$other": {
".validate": true
}
}
}
Run Code Online (Sandbox Code Playgroud) 我对 Firebase 比较陌生,正在尝试开发一个应用程序,该应用程序要求用户在注册页面中提供他们的名字和姓氏。但是 firebase createUserWithEmail 方法只存储电子邮件和密码。如何将此姓名和姓氏数据添加到我的应用程序并将它们与用户链接?我想我需要使用 FIRStorage 但那样,只有保存信息的选项是从 NSData 或 NSURL 保存,我该如何保存我的名字和姓氏字符串?
提前致谢!
Edit1:我想我错了,我需要使用实时数据库而不是存储来保存用户数据。但我仍然需要帮助。我来自 Parse,这看起来很复杂。
有一个名为createdTime的JSON字段,它的值是服务器的当前时间戳(看起来像这个{".sv":"timestamp"}),但模拟器不允许有".".(点)字段名称.我该怎么做才能模拟出来?

我正在使用Facebook图形API检索用户个人资料图片的Cloud Code函数。因此,我可以访问正确的图片URL,但是无法从该URL创建Parse.File。
这几乎是我正在尝试的:
Parse.Cloud.httpRequest({
url: httpResponse.data["attending"]["data"][key]["picture"]["data"]["url"],
success: function(httpImgFile)
{
var imgFile = new Parse.File("file", httpImgFile);
fbPerson.set("profilePicture", imgFile);
},
error: function(httpResponse)
{
console.log("unsuccessful http request");
}
});
Run Code Online (Sandbox Code Playgroud)
其返回以下内容:
Result: TypeError: Cannot create a Parse.File with that data.
at new e (Parse.js:13:25175)
at Object.Parse.Cloud.httpRequest.success (main.js:57:26)
at Object.<anonymous> (<anonymous>:842:19)
Run Code Online (Sandbox Code Playgroud)
有想法吗?
swift ×4
firebase ×3
ios ×3
angularjs ×2
amazon-s3 ×1
angular ×1
node.js ×1
typescript ×1
uibutton ×1
uitableview ×1