GithubHelp home page GithubHelp logo

1amageek / ballcap-ios Goto Github PK

View Code? Open in Web Editor NEW
227.0 14.0 28.0 1.26 MB

Firebase Cloud Firestore support library for iOS. 🧢

License: MIT License

Swift 99.24% Ruby 0.76%
cloudfirestore firebase firebase-storage firebase-firestore gcp swift

ballcap-ios's People

Contributors

1amageek avatar brightsider avatar giiiita avatar imaizume avatar kinergy avatar naturalui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ballcap-ios's Issues

Object' does not conform to protocol 'Modelable'

Describe the bug

A clear and concise description of what the bug is.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: _____
  • Pring version: _____

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Relevant Code:

// TODO(you): code here to reproduce the problem

documentReference issue

Why this is not referenced to path?

static var documentReference: DocumentReference {
return Firestore.firestore().document("version/(self.modelVersion)")
}

A way to avoid Firestore crash

Hello. I'll be very happy if you could help me with avoiding firebase crash in a module!

I'm trying to make a framework that wraps Firestore SDK, but it crashes.
According to some comments on GitHub, using Firebase from multiple modules have some difficulties.

Firebase is a linked statically and can only be linked once into an app. It cannot be linked into multiple dynamic frameworks.

from firebase/firebase-ios-sdk#4263 (comment)

My crash seems to be the same as this issue: firebase/firebase-ios-sdk#4271

I'm interested in how Ballcap-iOS avoid this problem since it wraps Firestore in a module.
Do you know how Ballcap-iOS avoids this problem?

I've uploaded my sample app which has the same crash. It crashes by executing tests.
https://github.com/yoching/FirestoreDependencyExperiment

Thank you!

firebase SDKのバージョンアップ

いつもお世話になっております。

firebase SDKは現在v10.21.0が公開されていますが、こちら対応されるご予定はございますでしょうか?

というのもプロジェクトのfirebase SDKのバージョンを上げたいと考えていたところ、Ballcapが使用しているfirebaseのバージョンに引っ張られて更新できないためそのご確認となります。

configure is inaccessible

Describe the bug

BallcapApp.configure showing the message "inaccessible due to internal protection level message".

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 10.2.1
  • Bellcap version: 0.6.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Put BallcapApp.configure in a class and after try to compile.

Relevant Code:

BallcapApp.configure(Firestore.firestore().document("version/1"))

WithSwiftUI Sample Crash

Describe the bug

WithSwiftUI example crashing on run.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: Version 11.3 (11C29)
  • Ballcap version: master

[REQUIRED] Step 3: Describe the problem

Example not compiling

Steps to reproduce:

Clone repo
Change directory to example/SwiftUI
pod install
Copy over GoogleService-Info.plist (works on other projects)

Error Message

2020-01-15 02:51:53.892641-0800 WithSwiftUI[3613:4281424]  - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2020-01-15 02:51:53.958240-0800 WithSwiftUI[3613:4281430] 6.11.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60103000 started
2020-01-15 02:51:53.958820-0800 WithSwiftUI[3613:4281430] 6.11.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
keyNotFound(CodingKeys(stringValue: "name", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"name\", intValue: nil) (\"name\").", underlyingError: nil))
Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /path/to/Ballcap-iOS/examples/WithSwiftUI/Pods/Ballcap/Ballcap/DataSource.swift, line 191
2020-01-15 02:51:54.117454-0800 WithSwiftUI[3613:4281428] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /path/to/Ballcap-iOS/examples/WithSwiftUI/Pods/Ballcap/Ballcap/DataSource.swift, line 191

FIRQuerySnapshotBlock is unavailable in Swift

I just made a pod update and am now using Firebase 10.1.0 and Ballcap 1.3.5 but when trying to build my app I get build errors inside Ballcaps Query.swift in lines 119 - 125.

        public func listen(includeMetadataChanges: Bool = true, listener: @escaping FIRQuerySnapshotBlock) -> ListenerRegistration {
            return query.addSnapshotListener(includeMetadataChanges: includeMetadataChanges, listener: listener)
        }

        public func get(completion: @escaping FIRQuerySnapshotBlock) {
            query.getDocuments(completion: completion)
        }

The error is for both functions

'FIRQuerySnapshotBlock' is unavailable in Swift: Use Swift's closure syntax instead.

Does anyone else have the problem?

I'm using:

  • Xcode 14.0.1
  • Cocoapods 1.11.3
  • Firebase 10.1.0
  • Ballcap 1.3.5

DataSource updates not working for last deleted document in collection

Describe the bug

When deleting last document in collection, DataSource not picking up changes and do not notify about removed items.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 10.3 * Ballcap version: 0.10.4

[REQUIRED] Step 3: Describe the problem

If last document in collection deleted snapshot is not processed. Issue caused by this line.

guard let lastSnapshot = snapshot.documents.last else {

When deleting last document lastSnapshot is nil and self._execute(snapshot: snapshot) not getting called.

Is it possible to remove a field from a document

I'm using Ballcap in a SwiftUI environment and I have a class that contains an optional field of type DocumentReference in its Model.
Initially the field does not exist but I can set it through the UI of my app. This works just as expected.
But I would like to be able to also remove the reference. I tried setting it to nil but this doesn't work unfortunately.

Is there currently any way to achieve this with Ballcap?

Thanks for your help!

Allow initialization of Object subclasses with models

Is your feature request related to a problem? Please describe.
Model's of Object subclasses require empty init methods:

class User: Object, DataRepresentable {
    var data: Model?
    
    struct Model: Modelable, Codable {
        let id: String
        let firstName: String
        let lastName: String
        
        init() {
            self.id = ""
            self.firstName = ""
            self.lastName = ""
        }
        
        init(id: String, firstName: String, lastName: String) {
            self.id = id
            self.firstName = firstName
            self.lastName = lastName
        }
    }
}

And when used require doing a little dance with initializing separately and assigning:

let user = User()
let model = User.Model(id: userId,
                           firstName: firstName,
                           lastName: lastName)
user.data = model
user.save()

This is un-ideal as you need to write so much repetitive boilerplate for every Object subclass, and you can forget to assign the model to object.data.

Describe the solution you'd like
When initializing an instance of a subclass of Object it would be great if we required the data model to be provided along with it:

let model = User.Model(id: userId,
                           firstName: firstName,
                           lastName: lastName)
let user = User(data: model)
user.save()

Which would enable us to simplify the model blueprint to:

class User: Object, DataRepresentable {
    var data: Model?
    
    struct Model: Modelable, Codable {
        let id: String
        let firstName: String
        let lastName: String
    }
}

Describe alternatives you've considered
I listed the alternative route I'm using above.

Additional context
I'd be happy to help develop this if you think it would be a worthwhile feature.

How to remove document<>

image

print(Document<User>.modelName) // user

I'm a Pring user. I appreciate it.

ModelName is user, but collection name is document<user>. In case of Pring, collection name is user. Is this a Ballcap's feature? Can I change collection name without overriding Document class?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.