Back

Appwrite-apple - getting this error: -65563: ServiceNotRunning

  • 0
  • Apple
deadMan
4 Mar, 2024, 07:33

Hey,

I'm new here I am using appwrite cloud

I have already implimented in Dart and working fine I am able to create - read document but I need one app for macOS also, I have tried to get countries and other apis all are not working and also I am not able to create-read document

in macOS I am getting same error -65563: ServiceNotRunning Please help me if you know how to handle this

TL;DR
The error -65563: ServiceNotRunning is occurring when attempting to implement an Appwrite service in an App for macOS. The issue may stem from the setup or configuration. **Solution:** Check the service configuration in the AppwriteManager class and ensure that the client is properly initialized with the correct endpoint, project, and self-signed settings. Verify that the getDatabase function is correctly returning the database object. Review the code for any potential errors or typos that could be causing the issue.
deadMan
4 Mar, 2024, 07:36
TypeScript
    
    static let shared = AppWriteManager()
    
    private init() {}
    
    func uploadTweet(_ models: [TweetUIViewModel], documentId: String) async {
        let db = getDatabase()
        do {
            let countries = try await Appwrite.Locale(client).listCountries()
            print(countries)
            let result = try await db.createDocument(
                databaseId: "",
                collectionId: "paid_tweets",
                documentId: documentId,
                data: [
                    "tweets": models.map { getRemoteTweet(from: $0) }
                ]
            )
            print("result: \(result)")
        } catch let error {
            print("Error....... \(#function)", error)
        }
    }
    
    private let client = Client()
        .setEndpoint("https://cloud.appwrite.io/v1")
        .setProject("")
        .setSelfSigned(true)
  
    
    private func getDatabase() -> Databases {
        let db = Databases(client)
        return d
    }
    
    private func getRemoteTweet(from: TweetUIViewModel) -> [String: Any] {
        return [
            "title": from.title,
            "rate": Int(from.rate) ?? 0,
            "desc": from.desc,
            "by": from.by,
            "id": UUID().uuidString
        ]
    }
    
}

This is my code, every time I get the same error

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more