Auto-renewable subscription questions (for Swift and PHP) [closed] - swift3

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a few questions about auto-renewable subscription. I apologize in advance if these questions are out there but I figured asking these questions here was my best place to start.
Does anyone know the best tutorial on auto-renewable subscriptions? The ones I have found all had problems somewhere. The way I want it set up is that once the user purchases it will run a php script and update the database then redirect the user to the membership section.
What is the best way to check if the user is still paying for their membership and haven't cancelled it? If cancelled then I will run a php script to update the database.
If possible how can the user cancel the auto-renewable subscription from the app? Say the user deletes their account then in the backend Swift I want to also cancel the subscription.

These questions are pretty broad and subjective. There are a lot of ways this could be set up depending on your requirements.
1) The links below may help. You'll need to build an API you can send the purchase receipt from the client. Your server will handle receipt validation, update your database, etc. then return a successful response that will be your trigger to transition to the membership section.
2) With the receipt saved on your server, periodically poll Apple's /verifyReceipt endpoint to get the most up-to-date subscription status for the user. You can combine this with Apple server-notifications which can be another trigger for you to refresh the receipt.
3) The can't cancel their subscription from within your app, there's no developer APIs to manage subscriptions. They can only cancel from the Apple subscription management page. If you've implemented #2 correctly you'll know about these cancellations shortly after they occur. Remember that when a user cancels they should still be able to access their subscription until the end of the billing period they have paid for, unless the cancellation was due to a refund.
Some helpful links to get you started:
Overview on handling auto-renewable subscriptions: iOS Subscriptions are Hard
What to build in your server: How to Build a Great iOS In-app Purchase Subscription Server
(Alternatively, since you're on a deadline you can use a hosted solution like RevenueCat that handles all of this and more right out of the box)

Related

Google Cloud Platform Not Letting Me Add A Billing Account [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
My product basically revolves around a particular google cloud platform feature, for which I need to add a billing account. Whenever I go to do that, it doesn't let me add it. What happens is I try signing up for a free trial, but when I tell it to verify my card details and send me an OTP, despite entering the valid OTP it still returns me to the exact same page.
I click the start button:
Then it prompts me to enter my cvv, which I do.
Even after doing all those things, correctly entering everything, including the OTP it sends, I land on the exact same page. There is no option whatsoever to proceed or anything.
Side note, if it helps I'm in India and I'm using a MasterCard
EDIT:
I forgot to mention it was actually deducting the balance from my account, but still not letting me proceed
I assume that your issue is related to the known issue with creating GCP billing accounts.
Please follow this issue report at the Google Public Issue Tracker to be updated. Feel free to add comments, CC yourself to receive emails with updates and press +1.

AWS serverless send SMS to user [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am trying to build a small web application with AWS but because the services are new to me I am having a hard time. My boss asked that there be a page where the user inserts his phone number before he participating in the research study. After the participant inserted his phone number he will receive 4 text messages (SMS) during the day with a task to perform. The messages will be sent 4 times a day (8:00, 12:00, 16:00, and 20:00) for 10 days, not including Friday and Saturday. could you help me to understand how to approach this project and whether it is possible to do it with AWS?
Thanks in advance,
Orly
One possibility is creating a Simple Notification Service Topic for each new user. Next you would subscribe the user's phone number to the Topic. You can then publish to this Topic the message (under 140 characters) that you want sent.
This use case is very possible with AWS. There are different ways to implement this functionality. To address this use case:
"The messages will be sent 4 times a day (8:00, 12:00, 16:00, and 20:00) for 10 days, not including Friday and Saturday. "
You can build serverless workflows using AWS Step Functions that can perform this use case. AWS Step Functions can invoke many different AWS Services to meet your business needs. For your use case to send a text message, you can invoke the Simple Notification Service.
In fact a workflow can send messages over different channels. Here is a Java based use case that walks you through how to build a workflow that can send messages (including Voice, Email, and Text messages).
Using AWS Step Functions and the AWS SDK for Java to build workflows that sends notifications over multiple channels
As you can see, this workflow reads data in an AWS database to get a result set. For your use case, this sounds applicable.
You can invoke this workflow too from another Lambda function. You can schedule a Lambda function to be invoked x number times a day using CRON expressions as discussed in this document:
Creating scheduled events to invoke Lambda functions
Finally, you can build a solution that lets users enter data into a web form and have that data be persisted in RDS or DynamoDB. We have an AWS development article too for that. For example, assume you want to store user data in DynamoDB.
Creating the DynamoDB web application item tracker
As you can see, by combing functionality covered in these various AWS tutorials, you can build the solution that you describe.
These articles are implemented by using AWS SDK for Java V2. However, if you are working in other programming languages, you need to port the logic to your programming language.

Django building a user-to-user messaging system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm trying to build a messaging system for my website using Django but I don't know how to do. What I want is a system that enables a user to send a message to another user, with an inbox to see the received messages and notifications that warn the user he received messages. Since it's a feature many websites need, I guess there already exists some build-in functions and templates to do that in Django. I made some researchs and I found existing apps like django-messages or django-postman but there are little or no documentations about these apps, the ways to use it in the view, the way to customize the message model or the templates, ... . I guess these apps are not widely used since there are no tutorials about them or precise documentation, but I didn't found other apps for messaging.
To summarize my question, what is the easiest way to build a customizable messaging system in Django ? If it's an app, where can I find good and easy documentation/tutorial about it ?
Thanks in advance !
If you want a quick & simple solution I can suggest:
Create a Conversation model which will hold participants and messages using m2m fields.
Create a Message model which will hold sender, recipient and message content and other metadata (send date, read date etc.)
Then you should create a save method for message which will create a Conversation object according to sender and participant.
The rest is creation of some querysets which will filter out messages and conversations.

Which one is better to user between Parse, Firebase and AWS Cognito? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am willing to use synchronisation service for my application. But I want to choose the best one. I want to know which one is better among all these. My application will run on Android , IOS , Windows and Web.
I am going with Firebase because I tested it. It is giving me fast results and it is also allowing me to work offline. Is it better or I will go with Parse or AWS Cognito?
I Also have an option of Google Cloud. Does Google Cloud provides service like Firebase? And are realtime updates possible with Parse as like Firebase?
Codeek has a good point that this question is opinion based, so take my answer with a grain of salt.
I have experience with both Parse and Firebase, but not with Cognito.
In my experience, Parse is better when working with large relationship-based databases. (I.E. databases where multiple classes of objects are pointing to each other and interact.) In this system, it is easy to store a lot of data very succinctly, but working with this data is done via snapshots. This means that you can take a snapshot of the data, edit it, and then refresh the server with the updated snapshot. This is perfect for things like my delivery application where only one user is updating the orders on our server at any one time.
Firebase implements a model-observer scheme, and so it is much better for applications that are highly interactive. For instance, I have used Firebase for creating a real-time game of hot potato. The advantage here is that changes to the data on the server are automatically pushed out to all devices that have registered as listeners (functionality not available on Parse from my experience). This keeps all users on the same page all the time. The downside is that the database is structured in a hierarchal manner and doesn't have defined "objects". Rather, it is structured via key/value pairs where parent keys cannot have an associated value. To illustrate this, a sample structure for storing a game on my database went something like this:
-Games
--1
---Users
----1 = "example#gmail.com"
----2 = "example2#gmail.com"
---PotatoHolder = 1
---TimeRemaining = 30
---Loser = -1
Cognito I am not familiar with, so I'll allow someone else to explain how that database system is designed.
In summary, codeek is correct that this is an opinion-based question, but for two of your options a good rule of thumb from my experience is that Parse is fantastic for large relationship databases in conjunction with single-user applications (i.e. single-player or turn based games). Firebase is more suited to hierarchal data systems in conjunction with real-time multiplayer applications.
I hope this helps! If you could post a little more about what kind of application you are trying to build then perhaps I, or someone else, could provide a little more guidance.
Expanded Answer: Although this question has been marked as off topic, to answer Nidhi's follow-up question if there is a way to use Parse as a model-observer scheme: Not easily. Using a timer is the simplest option. The other option is to use push notifications. This would require getting permission from you user. You can set the Cloud Code on Parse to automatically send push notifications all relevant users and then intercept them within your client so that they are "silent". In other words, when they arrive, you can have your client respond by updating your game without showing a ribbon or notification like normal push notifications. I have not done this myself, as I prefer using Firebase for that kind of application, but I believe that it is possible.
Source: PFQueryTableView Auto Refresh When New Data Updated or Refresh Every Minute Using Parse
Keith's answer is similar to Nidhi's reference to refreshing PFObjects via a Timer, Handsomeguy's comment refers to the possibility of "silent" push notifications.

Collecting data from website without API [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am looking to build a webapp to improve user experience in booking railway tickets in India. The API is impossible to get due to hefty charge to procure it. I have seen many apps that provide details of the trains etc through their apps.
My Question is how are they scraping data from the website.In general how can I legally get data shown to user (I don't want payment and stuff that are impossible without API) on any website. How do people scrape such data? Any tools/methods?
Bear with me if question is naive. I'm pretty new to this stuff.
They can get the train schedule information using any one of several programming languages though it is most likely done with ordinary PHP and any good webserver host. For example all indian train schedules can be found on the indianrail.gov website.
Sending a specially built URL to ..
http://www.indianrail.gov.in/cgi_bin/inet_trnnum_cgi.cgi?lccp_trnname=1123
using the POST method of sending form data should give you all the details for train number 1123 After that it becomes just a simple task of tidying up the results for storage in a database.
Update: well armoured site its checking both the user agent and referer of inbound requests.
Ammendum: the indianrail.gov site is changing to http://www.trainenquiry.com/ -> will have to take another look