What has happened to the Google jsapi for inapp purchases? This code worked 2 days ago and stopped working yesterday.
I load the script from here
and then load the payments:
google.load('payments', '1.0', {
'packages': ['sandbox_config']
});
Then when I call the purchase:
goog.payments.inapp.buy({ etc ...
I get is a script error 'goog' is undefined.
Related
It's been almost a week since my app went Live, but my live Google ads are not showing at all.
I've tried double checking everything I could think of, such as making sure the App ID and Ad ID are correct, but I'm having no luck with them.
I have the following 2 functions to load and show the ads
public func loadAd() {
interstitial = GADInterstitial(adUnitID: "ca-app-pub-3228561607874346/1546949023") //Live Ad 2
let request = GADRequest()
interstitial.load(request)
}
public func showAd() {
if (interstitial.isReady) {
interstitial.present(fromRootViewController: self)
loadAd()
} else {
print("Ad wasn't ready")
}
}
I tried running it with test ads using the test ad ID that were given to me on Google's tutorial page and that seems to be working fine, just not my Live Ad.
The only thing that flags or catch my attention is the console is printing:
[I-ACS023136] Configuration does not have valid Google App ID.
and
[I-ACS034010] Transaction failed
But like I said, I double checked my config in my info.plist file and all seems to be fine.
There are over 200 requests made and 0% match-rate. I just don't know what it could be.
I've done some research and most people solved their issues related to AdMob by waiting a few days. Since your app went live more than a week ago, I believe that's not the issue. Another possible solution is to share your app with more people, in order to send more requests to Google Servers. According to this answer:
For newly created ads to work, Admob need more requests to start showing ads.
Also:
Make sure that Google Mobile Ads SDK is properly integrated.
Make sure that you are using the Real ID because sometimes the Test ID is used by default.
Make sure there are no restrictions on your account.
Make sure that the account setup is fully completed. Payment information, name, address, phone number, and tax info in your AdMob account with verification if applicable.
Check that the eCPM floor settings are not set too high.
An unlikely but possible reason could be lack of inventory.
If none of the above worked, you can try these troubleshooters:
Performance Troubleshoot - Can't see ADS Troubleshoot
More info:
Common reasons for ads not showing
Your code loads the interstitial ad inside the if condition.
Call your load before you check if it is ready.
interstitial.isReady indicates that the ad is fully loaded.
You can see this website for more information: https://developers.google.com/admob/ios/interstitial.
It is also better practice to call loadAd function in viewDidLoad and display it when needed.
I also recommend using the test id for Google Admob.
It is listed in the url: https://developers.google.com/admob/ios/test-ads
Don't forget to include Admob App Id in GoogleService-Info.plist. I think it is included automatically, but you can check it.
I'm trying to add push notifications to my Ionic app using FCM and running into issues with IOS, (android works as intended). Before marking this as a duplicate, Ive tried the solutions from the other similar questions but it didnt help.
In the firebase console I have set the team Id, App id as well as uploded the APNS p5 generated by apple to my console as well.
And finally, the latest plist file to my app's root. From xcode, I can see the certificate has push notifications enabled too and the app asks for that permission for it as well. After that I got the device notification id and tested it via the console as well as the api endpoint but I keep getting the "InvalidApnsCredential" error. I did the steps from few other questions from here but had no luck. I cant seem to get it working, below is a few snippets of my code
this.platform.ready().then(() => {
this.fcmService.getToken().then(resp=>{
this.httpService.sendToken(resp)
.subscribe(res => {
console.log(res)
});
console.log(resp)
});
});
And the body of the api post request
Endpoint: https://fcm.googleapis.com/fcm/send
Body:
{
"notification":{
"title":"Ionic 4 Notification",
"body":"This notification sent from POSTMAN using Firebase HTTP protocol",
"sound":"default",
"click_action":"FCM_PLUGIN_ACTIVITY",
"icon":"fcm_push_icon"
},
"data":{
"landing_page":"second",
"price":"$3,000.00"
},
"to":"IOS_DEVICE_NOTIFICATION_ID",
"priority":"high",
"restricted_package_name":""
}
The code and api endpoint seems correct as it works for Android. Is there anything im missing to get it working?
So, this may not be exactly the answer that youre looking for but, for me everything worked fine after i recreated the app on ios.
Common issues include
- trying to send a notification before the client gives premission
- sending notifications using older IDs (yes they change sometimes)
- package name mismatch between your app and ios app
Following are the reasons of "InvalidApnsCredential":
Maybe bundle id changed [find in code where bundle id name mismatch, change it]
APN keys expired [ update it in firebase console]
Find out the exact error from this link enter link description here that you got.
In my case, I forgot to enter and upload the APNs Authentication Key in the firebase console. Please go to the
Cloud Messaging -> Apple app configuration
Add AuthKey File(.p8), Key Id & Team ID
Check the image below. And it's working fine for me.
Make sure Team ID is added in the SDK setup and configuration.
Status Update Notifications, statusUpdateNotification
I set Subscription Status URL in my APP in iTunes account like https://www.xxxxxx.xx/iospushnotification.php
I also successfully tested nscurl --ats-diagnostics https://www.xxxxxx.xx/iospushnotification.php
I also implemented php code in iospushnotification.php file to get JSON response
I purchased successfully Auto renewal Subscriptions Sandbox but I did not get any Status Update Notifications I get blank [] JSON response from apple server to my server.
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW6
if anyone still cares 2 years later, I found a solution, assuming you're using PHP.
from the stackoverflow post Receive JSON POST with PHP we need to do something like this:
$appleData = file_get_contents('php://input');
then try to json_decode($appleData) from there.
(I've never had to do something so weird to get POST data before, but I've mostly used frameworks before; unfortunately, I do not currently have that luxury...)
I am trying to let people like tracks, albums or playlists on Apple Music from a webpage.
I understand the manual on this page:
https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/AppleMusicWebServicesReference/SetUpWebServices.html
Until I hit the part where I should use the requestUserToken(forDeveloperToken:completionHandler:) method from SKCloudServiceController in the StoreKit framework, since there is no StoreKit framework available for outside iOS/macOS/tvOS/etc.
How is this token generated? Is there any other way I can generate this Music User Token manually?
I know it is a (very) longshot, but maybe someone figured it out!
The new Apple MusicKit JS library allows you to create Music User Token's from your Developer Token as seen here outside of iOS. Once you've loaded the Library you can use the authorize method to allow a user to authenticate and generate a token.
document.addEventListener('musickitloaded', function() {
// MusicKit global is now defined
MusicKit.configure({
developerToken: 'DEVELOPER-TOKEN',
app: {
name: 'My Cool Web App',
build: '1978.4.1'
}
});
let music = MusicKit.getInstance();
music.authorize().then(musicUserToken => {
console.log(musicUserToken);
});
});
I have tried the approach within my iOS app.
You can follow this link generate music token
This is basically python script. You can easily create a music developer token from your mac.
Is it somehow possible to get a list of all available products from the Play Store?
What I want to do is to get all available items and then show them in a ListView. Whenever someone taps the ListView the right item is opened in Google Play Store.
Is that possible? And if yes, how?
As mentioned in this post, this is now possible using the Google Play Developer API (a.k.a. android-publisher):
https://developers.google.com/android-publisher/
In particular, the Inappproducts: list API:
List all the in-app products for an Android app, both subscriptions and managed in-app products.
Third-paty apis and services are not reliable. There is no reliable and convenient way for production yet. You have to store it on your server in encrypted json data file for example, without any php/java/something, just static file.
OR you can guess item skus in your code and check even non-existing items: myitem_00-myitem_99 for example.
You can try this Google Play Store Api, or you can also look into this Android Market API.
But both of these are unofficial.
This url will show you what to do:
http://developer.android.com/training/in-app-billing/list-iab-products.html#QueryDetails
You have to do below things.
establish the connection between your app and google play app.
Get the list of products which is register in your google console.
prapare arraylist that contains product's id name and put into Bundle
code to get purchase
ArrayList<String> skuList = new ArrayList<String> ();
skuList.add("premiumUpgrade");
skuList.add("gas");
Bundle querySkus = new Bundle();
querySkus.putStringArrayList(“ITEM_ID_LIST”, skuList);
finaly one methode is reday in google_play_app that we need to call
Bundle skuDetails = mService.getSkuDetails(3,
getPackageName(), "inapp", querySkus);
call the getSkuDetails method on the In-app Billing Version 3 API, and pass the method the In-app Billing API version (“3”), the package name of your calling app, the purchase type (“inapp”), and the Bundle is our response
extract the bundle and get the product names and display it in ativity.