Getting Rating for an App from Apple AppStore - ios

I want to create a report regarding my App's rating in three dimensions - date, Country and App Version (I know that from Android I can get in a query only Date+Another Dim, not quite sure how it works with Apple...). I found the "Reporter" (https://help.apple.com/itc/appsreporterguide/#/itcbd9ed14ac) but it allows me only finance reports... I also saw the RSS option - only this option gives me the "last X reviews"' and I just want an aggregated data (lets say - for each day, how many 1 star rating, 2 star rating etc'...)
If someone can help me with how to do so (preferably in bash/python script), I'd really appriciate it. Thank you!

The easiest way to get them out of iTunes Connect is probably with Spaceship. (App > Activity > Ratings & Reviews
# Get reviews for a given store front
reviews = ratings.reviews("US") # => Array of hashes representing review data
https://github.com/fastlane/fastlane/blob/master/spaceship/docs/iTunesConnect.md#app-ratings--reviews

The Appfigures API can give you ratings and reviews for iOS and Android apps.
The following request will give you the last 50 reviews from any country, but you can easily get more reviews, limit by country/version/etc.
GET https://api.appfigures.com/v2/reviews?count=50
While will give you something like this:
{
"total": 140,
"pages": 28,
"this_page": 1,
"reviews": [{
"author": "DeveloperToDeveloper",
"title": "Just Spectacular",
"review": "Finally able to remove the ads! The description is hilarious!! Thanks!!!",
"original_title": null,
"original_review": null,
"stars": "5.00",
"iso": "US",
"version": "1.2",
"date": "2017-05-19T17:05:00",
"product": 6567539,
"weight": 0,
"id": "5561747L7xnbsMRu8UbPvy7A71Dv6A=="
}]
}
Here's how you'd do it with Python:
import requests
USERNAME = 'USERNAME'
PASSWORD = 'PASSWORD'
APP_KEY = 'APP_KEY'
BASE_URI = "https://api.appfigures.com/v2/"
# Helper function for auth and app_key
# first / in uri is optional
def make_request(uri, **querystring_params):
headers = {"X-Client-Key": APP_KEY}
auth =(USERNAME, PASSWORD)
return requests.get(BASE_URI + uri.lstrip("/"),
auth=auth,
params=querystring_params,
headers=headers)
# Get the last 50 reviews for all of our apps
reviews_response = make_request("/reviews",
count=50)
assert 200 == reviews_response.status_code
assert 0 < len(reviews_response.json())
# Use the response to sum up ratings, analyze review text, etc.
FYI - Reviews and ratings are separate for apps, and while the 5 star rating on a review contributes to the total rating, there could also be ratings that aren't associated with a written review.
Those can be retrieved using the Ratings route.

Related

Query in firebase Database in iOS

I work with firebase database, I have the following data,
I need to get all groups names (GName) of a user by his phoneNum, i.e. all groups of specific user, How can I get that in swift 4?
You should consider restructuring your data. If a user belongs to more than one group in your application then you'll probably have to duplicate your user node for every group the user belongs to in your data structure. You can create another JSON object that holds all of the groups that a user belongs to. Here is a sample JSON for you:
{
"users": [{
"xyz123": {
"userId": "xyz123",
"username": "user1",
"phoneNum": "123456",
"groups": [{
"groupId": 1,
"groupName": "aaa"
}, {
"groupId": 2,
"groupName": "bbb"
}]
}
}]
}
As for filtering with the phone number, you can get all users inside a list and filter the result with the phone number criteria
result = result.filter({item.phoneNum == "123456"})
or get phone number of the user to a upper level, call .child() method with the phone number criteria and fetch the specific user.
Also take a look at structuring data part at firebase documentation.
https://firebase.google.com/docs/database/ios/structure-data
Hope that helps.

Error in getting topic title in D2L

So I am trying to get the quiz names from course in D2L using this API GET /d2l/api/le/(version)/(orgUnitId)/content/topics/(topicId) http://docs.valence.desire2learn.com/res/content.html#get--d2l-api-le-(version)-(orgUnitId)-content-topics-(topicId)
But I am response which has wrong topic 'Title' field.
GET /d2l/api/le/1.4/6671/content/topics/1134
Response:
{
"DueDate": null,
"TopicType": 3,
"Url": "/d2l/common/dialogs/quickLink/quickLink.d2l?ou=66xx&type=quiz&rCode=1A4DE57C-F-3xx",
"StartDate": null,
"EndDate": null,
"IsHidden": false,
"IsLocked": false,
"Id": 1134,
"Title": "/d2l/common/dialogs/quickLink/quickLink.d2l?ou={orgUnitId}&type=quiz&rCode=1A4DE57C-F-3xx",
"ShortTitle": "",
"Type": 1
}
I created this quiz directly from course module --> new --> new quiz. But If I create quiz from Quizzes (Top menu) --> Manage Quiz --> New quiz. Then I get correct Title. Do I need to add some settings in quiz to get correct Title? Is there better way to get names?
We are running v10.3 of LMS
Unfortunately, this is a known issue, and will be addressed with due priority but D2L currently does not have an expected timeline for fixing it. If you'd like to track the status of this issue, or lobby for an increased priority on this issue, D2L encourages you to do so via your account or partner manager, or approved support contact.

Rails: How to disable app after certain amount of usage

I have a Rails/Shopify app that processes orders from the User's Shopify store. I want to have tiered plans (e.g. Bronze < 20 orders, Silver < 100 orders, Gold 100+).
What's the best way to implement this?
1) How do I track which subscription plan they are on, when it changes etc?
2) How do I disable the app once a user hits their limit?
Any links to articles/tutorials/gems to help would be great.
I would do it the following way. Once you have the token you can access the application charges for the shop you're in. You could either use
GET /admin/recurring_application_charges/455696195.json
or like I use it
ShopifyAPI::RecurringApplicationCharges.current
which gets you the current plan the user is on. You can access the name of the plan etc. To track how many orders were processed I would write a controller and implement a simple counter. Each time a request is being sent the counter is incremented. Once the limit is reached you can redirect him to an error page or somewhere else.
To answer the second part of your question you could access the current charge as mentioned above and get all the information you need (e.g. "billing_on": "2015-03-27T00:00:00+00:00")
Here is a sample response with all the available fields:
HTTP/1.1 200 OK
{
"recurring_application_charge": {
"activated_on": null,
"api_client_id": 755357713,
"billing_on": "2015-03-27T00:00:00+00:00",
"cancelled_on": null,
"created_at": "2015-03-28T13:31:19-04:00",
"id": 455696195,
"name": "Super Mega Plan",
"price": "15.00",
"return_url": "http:\/\/yourapp.com",
"status": "pending",
"test": null,
"trial_days": 0,
"trial_ends_on": null,
"updated_at": "2015-03-28T13:31:19-04:00",
"decorated_return_url": "http:\/\/yourapp.com?charge_id=455696195",
"confirmation_url": "https:\/\/apple.myshopify.com\/admin\/charges\/455696195\/confirm_recurring_application_charge?signature=BAhpBENfKRs%3D--a911ece9470850c96f6c7735c684b8a3f6869594"
}
}
You can find more under https://docs.shopify.com/api/recurringapplicationcharge or https://docs.shopify.com/api/applicationcharge
Hope I could help

Paypal recurring payments with variable amount 2 (in Spain)

some days ago, I wrote this post regarding Paypal recurring payments with variable amount Paypal recurring payments with variable amount
I marked it as fixed, however it is not.
First, I decided to develop approach 1 (by removing old profile and creating a new one). This worked. But, after that I realized, that I didn´t cover all my requirements. So finally, the right approach for me is number 2. This means, as #Andrew Angell suggested, I will develop a custom billing system that bills the customers. For that, I will create Billing Agreements and I will use the returned ids to execute Reference transactions with the amount I need and whenever I need. So far, it´s right?
According to Paypal docs, this is possible: https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/
So, I´m trying to follow the steps, so first a execute a setExpressCheckout:
# Paypal setExpressCheckout
def setExpressCheckout(billingType, returnURL, cancelURL, price, description)
#api = PayPal::SDK::Merchant::API.new
if billingType == "credit-card"
billingType = "Billing"
else
billingType = "Login"
end
#set_express_checkout = #api.build_set_express_checkout({
SetExpressCheckoutRequestDetails: {
ReturnURL: returnURL,
CancelURL: cancelURL,
LocaleCode: "US",
LandingPage: billingType,
PaymentDetails: [{
NotifyURL: returnURL,
OrderTotal: {
currencyID: "EUR",
value: price
},
ShippingTotal: {
currencyID: "EUR",
value: "0"
},
TaxTotal: {
currencyID: "EUR",
value: "0"
},
PaymentDetailsItem: [{
Name: description,
Quantity: 1,
Amount: {
currencyID: "EUR",
value: price
},
}],
PaymentAction: "Authorization" # To authorize and retain the funds, and when booking is confirmed capture them.
}],
BillingAgreementDetails: [{
BillingType: "MerchantInitiatedBillingSingleAgreement",
BillingAgreementDescription: description
}]
}
})
# Make API call & get response
#express_checkout_response = #api.set_express_checkout(#set_express_checkout)
# Access Response
if #express_checkout_response.success?
#token = #express_checkout_response.Token
puts "setExpressCheckout completed OK :)"
#paypal_url = #api.express_checkout_url(#express_checkout_response)
else
puts "setExpressCheckout KO :("
#express_checkout_response.Errors
puts "#express_checkout_response=" + #express_checkout_response.inspect
end
#express_checkout_response
end
However, I get this error:
#LongMessage="Merchant not enabled for reference transactions", #ErrorCode="11452"
It´s quite clear, just need to contact Paypal support guys and ask them to enable Reference transactions in my Paypal sandbox account. Right? I already did it and I´m just waiting.
However, what really worries me, is that I called Paypal support and they told me that this approach will not work in Spain. Although it´s in the doc, it´s only working in UK. Is this true?
If it´s true, I´m really in a trouble, because as far as I know, Paypal doesn´t not support subscriptions with variable amount.
Paypal technical support guy has enabled my sandbox account to reference transactions. I have developed the logic and it´s working. At least, in Sandbox and in Spain.
So, I will assume, it works.
Bad the Paypal guy on the phone that told me it wasn´t possible.

Get event rsvp summary using koala gem in rails

I have been able to retrieve event details using
#graph = Koala::Facebook::API.new(access_token)
#eventSummary = #graph.get_object(eventId)
and getting users list invited using
#eventSummary = #graph.get_connections(eventId, "invited")
I want to get count for all user invited, maybe, Declined and accepted for the event. for which i'm using
#eventSummary = #graph.get_connections(eventId, "invited?summary=1")
which again giving me the list of users only. when used graph.facebook like
https://graph.facebook.com/***eventId***/invited?access_token=*****access_token****&summary=1
i'm getting the count in result.
{
"data": [
{
"name": "xyz",
"rsvp_status": "attending",
"id": "10000000123"
}
],
"paging": {
"next": "https://graph.facebook.com/***eventId***/invited?summary=1&access_token=***accesstoken***&limit=5000&offset=5000&__after_id=100004389574321"
},
"summary": {
"noreply_count": 0,
"maybe_count": 0,
"declined_count": 0,
"attending_count": 1,
"count": 1
}
}
for just solving purpose i'm getting result using fql, as:
#eventSummary = #graph.get_object("fql", :q => "SELECT all_members_count, attending_count, declined_count, not_replied_count, unsure_count FROM event WHERE eid = #{eventId}")
But this is not convenient to use.
Can anyone please help, what am i doing wrong ? To get Event RSVP counts.
I'm using rails v.3.2, for facebook using Koala gem.
Thanks in advance.
I've seen it too, that when you request the event itself, those attendee count fields aren't included. You can use the second parameter to specifically ask for them though:
#eventSummary = #graph.get_object(eventId)
#eventSummary.merge(#graph.get_object(eventId, fields: "attending_count,declined_count,interested_count"))
The first call gets your "standard" event details, something like this:
{"description"=>"Blah blah blah",
"name"=>"My Event Will Rock",
"place"=>{"name"=>"Venue Bar",
"location"=>{"city"=>"Citytown",
"country"=>"United States",
"latitude"=>43.05308,
"longitude"=>-87.89614,
"state"=>"WI",
"street"=>"1216 E Brady St",
"zip"=>"53202"},
"id"=>"260257960731155"},
"start_time"=>"2016-04-22T21:00:00-0500",
"id"=>"1018506428220311"}
The second call gets just those "additional" requested fields:
{"attending_count"=>3,
"declined_count"=>0,
"interested_count"=>12,
"id"=>"1018506428220311"}
You can store them in separate variables, or as I'm suggesting above, use the hash#merge method. (There shouldn't be any problematic overlap between the keys of these two hashes.)
Alternatively, you can get all these details in one request by explicitly requesting everything you want.

Resources