appwrite / templates

Templates for Appwrite Functions ⚡️🌩️
https://appwrite.io
MIT License
121 stars 87 forks source link

🚀 Feature: Add WhatsApp with Vonage for Swift #209

Closed gewenyu99 closed 11 months ago

gewenyu99 commented 1 year ago

Appwrite Functions allow you to extend and customize your Appwrite server functionality by executing your custom code. 🤩 You can learn more at our official Appwrite Functions docs.

Your task is to implement the WhatsApp with Vonage function in Swift. You can look at the existing Appwrite Functions Templates in another coding language.

Your function should behave and be implemented similarly to existing WhatsApp with Vonage Node.js template.

Tasks summary:

If you need any help, contact us on our Discord server.

Are you ready to work on this issue? 🤔 Let us know, and we will assign it to you 😊

Happy coding!

RV784 commented 1 year ago

I'd like to work on this issue, please assign!

Haimantika commented 1 year ago

I'd like to work on this issue, please assign!

Hi @RV784 have assigned the issue to you! Thank you for showing interest in contributing to Appwrite! Happy Hacktoberfest 🎃

Notes:

  1. Please update us with your progress every 3 days, so that we know that you are working on it.
  2. Join us on Discord - https://appwrite.io/discord to chat about Hacktoberfest and Appwrite!
RV784 commented 12 months ago

I've started working on this feature today. Will keep this thread updated about the progress and ask here whenever I'll need help. @Haimantika

sdroyc commented 12 months ago

Hey I would also love to work on this

Haimantika commented 12 months ago

Hey I would also love to work on this

Hi, we are assigning issues on a first-come, first-serve basis, if the other user decides to drop off, we will assign it to you.

RV784 commented 12 months ago

Hi, as I was going through understanding templates and Appwrite functions, I noticed a couple of things in the starter function that is already Implemented

Do let me know if I'm not building it correctly in this case. I'm on Xcode-15. @Haimantika @gewenyu99

gewenyu99 commented 12 months ago

Hi, as I was going through understanding templates and Appwrite functions, I noticed a couple of things in the starter function that is already Implemented

  • I was getting the following build error at my end
Screenshot 2023-10-04 at 8 18 04 PM
  • This went away after changing the location of index.swift like mentioned in the below screenShot.
Screenshot 2023-10-04 at 8 15 30 PM

Do let me know if I'm not building it correctly in this case. I'm on Xcode-15. @Haimantika @gewenyu99

I don't think you can build Appwrite functions locally :) They're a file depended upon by the Appwrite Functions runtimes

RV784 commented 12 months ago

Hey, just wanted to ask that between these two approaches of saving the variables (vonage secret keys, whatsApp number etc). Should I go with .env file or .plist file for storing them?

First I'll go with .env file but wanted to clear this doubt.

RV784 commented 11 months ago

Hi, I’m done with the Implementation of this function

Here is the progress of what I’ve done

Things remaining

Also it would be very helpful if you could checkout the code I pushed and tell me things that can be improved.

@Haimantika @gewenyu99

RV784 commented 11 months ago

Hi, I saw that Swift-runtime is not available in cloud. Can you please guide me how to test it? Testing is somewhere that I got stuck.

If it goes well then I may've completed this feature implementation.

gewenyu99 commented 11 months ago

Hi, I saw that Swift-runtime is not available in cloud. Can you please guide me how to test it? Testing is somewhere that I got stuck.

If it goes well then I may've completed this feature implementation.

You can self-host and add deploy manually to test: https://appwrite.io/docs/advanced/self-hosting https://appwrite.io/docs/products/functions/deployment#manual

RV784 commented 11 months ago

Hi, I've successfully self-hosted Appwrite locally. Will update how the functions goes after I deploy it.

RV784 commented 11 months ago

I’m having a little trouble with Add deploy procedure.

Edit -> Found this article (https://dev.to/appwrite/clean-your-storage-using-appwrites-swift-cloud-functions-1h4f). First will go through this then get back here if still stuck

Haimantika commented 11 months ago

I’m having a little trouble with Add deploy procedure.

  • So first I’ve to package the whole swift WhatsApp with voyage function in a tar GZ file
  • Then I’ve to go to my Appwrite console that is locally hosted and upload this archived file I’m not sure where I’ve to upload my archived function file in the console.
  • Also can I use CLI or is it only for cloud functions?

Edit -> Found this article (https://dev.to/appwrite/clean-your-storage-using-appwrites-swift-cloud-functions-1h4f). First will go through this then get back here if still stuck

Thanks for the update. Even after the documentation if you have any questions, you can ask us on Discord

gewenyu99 commented 11 months ago

Hey, just wanted to ask that between these two approaches of saving the variables (vonage secret keys, whatsApp number etc). Should I go with .env file or .plist file for storing them?

First I'll go with .env file but wanted to clear this doubt.

So they are passed in as environment variables through the function :)

gewenyu99 commented 11 months ago

I’m having a little trouble with Add deploy procedure.

  • So first I’ve to package the whole swift WhatsApp with voyage function in a tar GZ file
  • Then I’ve to go to my Appwrite console that is locally hosted and upload this archived file I’m not sure where I’ve to upload my archived function file in the console.
  • Also can I use CLI or is it only for cloud functions?

Edit -> Found this article (https://dev.to/appwrite/clean-your-storage-using-appwrites-swift-cloud-functions-1h4f). First will go through this then get back here if still stuck

You should be using the CLI, but it would be even better if you setup GitHub integration instead :P

RV784 commented 11 months ago

Hi, so I manually deployed my function on self hosted Appwrite but I faced errors like shown in screenshot attached

Now most of them are syntactical but I want to ask

Screenshot 2023-10-21 at 11 11 10 PM

that since Xcode cannot infer the RuntimeContext/RuntimeOutput types that are mentioned in this function-Development guide -> https://appwrite.io/docs/products/functions/development#response

So can you tell in which environment should I like code the function in? Or like how do I set up this environment?

I also faced some JWT Authorisation errors but first I want to solve the above facing issues.

RV784 commented 11 months ago

Hi, I'm facing this error while Building a function with runtime Swift-5.8. This is according to this documentation regarding development for Swift Runtime -> https://appwrite.io/docs/products/functions/development#request

Screenshot 2023-10-23 at 12 20 31 PM
RV784 commented 11 months ago

So I was able to deploy the function. and I got this error no matter what I execute regardless of request method -> "An internal curl error has occurred within the executor! Error Msg: Connection reset by peer\nError Code: 500" Currently debugging this but if you know then do help here.

RV784 commented 11 months ago

Currently I'm trying my router's ip instead of localhost to see if it works or not.

tessamero commented 11 months ago

Closing issue due to inactivity and hacktoberfest being over, thank you for taking the time to be part of hacktoberfest this year :)