App Search API Validation Tool displays "example.com is returning 469. Please check your url and try again." - ios-universal-links

I am online a fresh webpage for the purpose of universal links. I put the file in .well-known folder.
In the server log I can see that Applebot got 200 on "GET /.well-known/apple-app-site-association HTTP/1.1"
The only error displayed in the App Search API Validation Tool is:
"example.com is returning 469. Please check your url and try again."
I used another tool to check it - branch.io AASA Validator and it displays no errors.

Also make sure you don't have any robots.txt file in the root that disables Applebot
Robots.txt: allow only major SE
https://support.apple.com/en-us/HT204683

Looks like apple changed the format of AASA file. According to this official document, the old presentation
{
"applinks": {
"apps": [],
"details": [
{
"appID": "{PREFIX}.{BUNDLE_ID}",
"paths": ["*"]
}
]
}
}
Had already changed to:
{
"applinks": {
"details": [
{
"appIDs": [
"{PREFIX}.{BUNDLE_ID}"
],
"components": [
{
"/": "/*"
}
]
}
]
}
}
Considering backward compatibility, you can try writing in this format:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "{PREFIX}.{BUNDLE_ID}",
"paths": ["*"],
"appIDs": [
"{PREFIX}.{BUNDLE_ID}"
],
"components": [
{
"/": "/*"
}
]
}
]
}
}
This works for me, hope it helps.

What worked for me was adding image metadata on top of title and description metadata. I also added Touch icons, but I do not think it caused the issue since it works fine on another website I have without it.
Required metadata seems to be: Title, description and Image (og:image was the missing one in my case)
For metadata check out: The Open Graph Protocol
For icons check out: Developer Apple - Configuring Web Applications

Related

Thumbnails not showing up after creating a post via linkedin API call

Thumbnails from external urls are not loading. However, the post inspector tool loads it just fine.
Page I used to perform some tests: https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html
Things I've tried so far:
Add an extra parameter at the end of the url in order to clear linkedin cache.
Post Inspector Tool
I did some research but I wasn't successful on finding a solution.
I created a post using different links like youtube and stackoverflow. Thumbnails didn't show up either.
I made sure each page has those required meta(open graph) tags that allows the crawler to retrieve information.
Here's an example of one of those API requests I've been calling to(I got this from the docs):
`
{
"author": "urn:li:person:{ID}",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Learning more about LinkedIn by reading the LinkedIn Blog!"
},
"shareMediaCategory": "ARTICLE",
"media": [
{
"status": "READY",
"description": {
"text": "Official LinkedIn Blog - Your source for insights and information about LinkedIn."
},
"originalUrl": "https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html",
"title": {
"text": "Official LinkedIn Blog"
}
}
]
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
`
In the Share Media object, you're missing the media attribute. It accepts LinkedIn URN so you'll need to upload the image. Personally, I'm not using that attribute but thumbnails that accepts image url. I don't see it in the docs anymore so something might have been changed. At least it's still working for me and I haven't seen it deprecated in the changelog yet. Be careful with the image requirements as well. It accepts an image url with this signature
{
...,
"thumbnails": [{
"url": "https://image-url.com"
}]
}

Using the LinkedIn API to update a profile header/background image

I am pretty new to the LinkedIn API. Does anyone know if there is a way to access a users profile header image/background image through the LinkedIn API? I have looked through the documentation and I cannot find it.
Also, if anyone has a good ASP.NET package that is built to work with LinkedIn so I don't have build the plumbing - would also love a recco.
Thanks.
JJO
linkedin
I found API documentation in https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-edit-api?context=linkedin/compliance/context#background-picture
Unfortunately, it's a complex process with 3 stes:
Register the background picture image to be uploaded.
1.1 POST https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest": {
"recipes": [
"urn:li:digitalmediaRecipe:profile-originalbackground-image"
],
"owner": "urn:li:person:ABCDEF",
"serviceRelationships": []
}
}
1.2 POST https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest": {
"recipes": [
"urn:li:digitalmediaRecipe:profile-displaybackground-image"
],
"owner": "urn:li:person:ABCDEF",
"serviceRelationships": []
}
}
Upload the background picture image to LinkedIn.
curl -i --upload-file /Users/peter/Desktop/superneatimage.png --header "Authorization: Bearer redacted" 'https://api.linkedin.com/mediaUpload/C5616AQEoeGkp7U5GEA/profile-uploadedBackgroundImage/0?ca=vector_profile&cn=uploads&m=AQIdKBw1WIgAWwAAAWhdlwvlhH13JEO0ZxBHb2VRuyAILbzD_VgJ-4UyLg&app=5480656&sync=0&v=beta&ut=1SpRkaq8G5DoA1'
Update the member's profile.
Use the asset from Step 1 to update the profile with the new background picture.
{
"patch": {
"backgroundPicture": {
"$set": {
"originalImage": "urn:li:digitalmediaAsset:C5604AQEMWf4Nl_mf2g",
"displayImage": "urn:li:digitalmediaAsset:C5616AQEoeGkp7U5GEA"
}
}
}
}

WordPress + Gatsby Custom Rest Route Not Showing in GraphQL

I'm fairly new to Gatsby and Im trying to build a site using WP as the content provider. I have a custom rest route built in WP
wp-json/lbt/v1/settings
and right now its just returning
{
"time_and_location": "Testing"
}
I cant seem to find out how to get that route to be available in graphQL for my Gatsby site. I have it set in my includedRoutes as
includedRoutes: [
'/*/*/categories',
'/*/*/posts',
'/**/lbt/**',
'/*/*/events',
'/*/*/pages',
'/*/*/media',
'/*/*/tags',
'/*/*/taxonomies',
'/*/*/menus'
],
I also see this when I spin up Gatsby
-> wordpress__lbt_v1 fetched : 1
-> wordpress__lbt_settings fetched : 1
I've searched a lot of different sites, but I haven't managed to find anything. Any help appreciated.
you need to add custom normalizer in "gatsby-config.js"
like
...
plugins: [
.....,
{
resolve: "gatsby-source-wordpress",
options: {
......
normalizers: normalizers => [ mapCustomApis,...normalizers],
}
}
......
add the "mapCustomApis" normalizer like
const mapCustomApis = {
name: `mapCustomApis`,
normalizer: function({ entities }) {
return entities.reduce((acc, e) => {
return acc.concat(e);
}, []);
}
}
i replicated the code from https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/src/normalize.js#L102
to support my custom Apis response
make sure your normailzer is before the rest of the normalizers

How to create a bookmarks folder with javascript?

I'm looking at the MDN Javascript API example for bookmarks.create(). I'm trying to implement the example they have to learn how to make a folder:
function onBookmarkAdded(bookmarkItem) {
console.log("Bookmark added with ID: " + bookmarkItem.id);
}
chrome.bookmarks.create({
title: "bookmarks.create() on MDN",
url: "https://developer.mozilla.org/Add-ons/WebExtensions/API/bookmarks/create"
}, onBookmarkAdded);
This does nothing as far as I can tell. Any help or other examples of how to make a folder for bookmarks would be greatly appreciated.
Assuming you have added "bookmaks" to the permissions in your manifest.json file, then your code works as written to create a bookmark. Because your manifest.json file is not included in the question, we can not determine if that is the problem.
To create a bookmark folder, you either omit the url property or provide url:null in the object that you pass to bookmark.create()
Below is the complete, tested (on FF48.0.2 and Developer Edition, FF50.0a2), extension. It is wrapped in code that allows creating the bookmark when a browser_action button is clicked. I find it easier for testing to have things execute when a browser_action button is clicked rather than just on install/Firefox run. It will:
Create a bookmark titled and linked: bookmarks.create() on MDN
Create a bookmark folder My Bookmark Folder A
Create a bookmark folder My Bookmark Folder B
Create a bookmark folder My Bookmark Folder B.1 within My Bookmark Folder B
All of these are created under "Other Bookmarks" because no parentId is provided when calling bookmark.create() for any of them which are not children of a bookmark folder this extension creates.
background.js:
//* For testing, open the Browser Console
try{
//alert() is not supported in Firefox. This forces the Browser Console open.
// This abuse of a misfeature works in FF49.0b+, not in FF48
alert('Open the Browser Console.');
}catch(e){
//alert() throws an error in Firefox versions below 49
console.log('Alert() threw an error. Probably Firefox version below 49.');
}
//*
chrome.browserAction.onClicked.addListener(function(tab) {
doBrowserAction();
});
function doBrowserAction(){
console.log('Background: Doing action');
createABookmark();
createABookmarkFolder();
createABookmarkFolderWithinABookmarkFolder();
}
function onBookmarkAdded(bookmarkItem) {
console.log("Bookmark added with ID: " + bookmarkItem.id, bookmarkItem);
}
function createABookmark(){
chrome.bookmarks.create({
title: "bookmarks.create() on MDN",
url: "https://developer.mozilla.org/Add-ons/WebExtensions/API/bookmarks/create"
}, onBookmarkAdded);
}
function createABookmarkFolder(){
chrome.bookmarks.create({
title: "My Bookmark Folder A",
url: null
}, onBookmarkAdded);
}
function createABookmarkFolderWithinABookmarkFolder(){
chrome.bookmarks.create({
title: "My Bookmark Folder B",
url: null
}, bookmarkItem => {
onBookmarkAdded(bookmarkItem);
chrome.bookmarks.create({
title: "My Bookmark Folder B.1",
url: null,
parentId: bookmarkItem.id
},onBookmarkAdded
);
});
}
manifest.json:
{
"description": "Create a bookmark on browser_action button click",
"manifest_version": 2,
"name": "Demo: Create Bookmark",
"version": "0.1",
"applications": {
"gecko": {
//Firefox: must define id to use some features (e.g. option_ui)
"id": "demo-create-bookmark#example.com",
"strict_min_version": "48.0"
}
},
"permissions": [
"bookmarks"
],
"background": {
"scripts": [
"background.js"
]
},
"browser_action": {
"default_icon": {
"32": "myIcon.png"
},
"default_title": "Do Action",
"browser_style": true
}
}
Obviously, if you are going to use the various functions for more than a demo, you will want to make them more general purpose (i.e. passing callbacks, bookmark properties, etc.).
Note: Please see the section titled "General notes on testing and development of WebExtensions in Firefox" of this answer. Your statement, "This does nothing as far as I can tell", implies that you are not looking at the Browser Console for error messages or console logs.

Chrome extension not injecting Javascript into iframe

I have a contentscript that essentially does a console.log to indicate that it has been injected into a page, and my manifest.json has all_frames set to true.
As a result, if I go to http://www.reddit.com/r/videos I see a message per frame and if I click on a video, I will also see a message coming from a script injected into the video's iframe. This indicates to me that if the page is dynamically modified to include an iframe, the contentscript will be injected into it.
When I go to http://www.html5video.org, I only get a message from one frame, but if I look at the DOM I see that there is an iframe for the video so I would expect my contentscript to be injected into it, but it is not.
My ultimate goal is to get a selector for the video on the page and I would expect to be able to do so by injecting code that looks for it into the iframe.
Help is appreciated.
I suspect that Chrome will inject your content scripts into an IFRAME that is part of the original page source which is the case with the reddit.com example - the IFRAMEs are part of the original page so Chrome can and will inject into those. For the html5video link the IFRAME is not part of the original source. However, if you inspect the elements you can see the IFRAME which suggests to me that the IFRAME has been dynamically loaded to the DOM. I see the same behaviour with an extension I have written so it seems consistent.
If you need to inject into the IFRAME then perhaps you can hook the DOM creation event and take the action you require:
document.addEventListener('DOMNodeInserted', onNodeInserted, false);
UPDATE:
What about this for http://html5video.org/ - using the following content_script code I can get the IFRAME and then VIDEO tag. Note: This approach/concept should also work pretty well too for Reddit.
content_script.js
console.log("content script for: " + document.title);
var timer;
document.addEventListener('DOMNodeInserted', onNodeInserted, false);
function onNodeInserted(e)
{
if(timer) clearTimeout(timer);
timer = setTimeout("doSomething()", 250);
}
function doSomething()
{
$media = $(".mwEmbedKalturaIframe");
console.log($media);
$video = $media.contents().find("video");
console.log($video);
}
manifest.json
{
// Required
"name": "Foo Extension",
"version": "0.0.1",
// Recommended
"description": "A plain text description",
"icons": { "48": "foo.png" },
//"default_locale": "en",
// Pick one (or none)
"browser_action": {
"default_icon": "Foo.png", // optional
"default_title": "Foo Extension" // optional; shown in tooltip
},
"permissions": [ "http://*/", "https://*/", "tabs" ],
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["jquery-1.7.1.min.js", "content_script.js" ],
"run_at": "document_idle",
"all_frames": true
}
]
}
See also: jQuery/JavaScript: accessing contents of an iframe

Resources