apple-app-site-association - only allow some paths to be opened in app and disallow everything else - ios-universal-links

I'm struggling to figure this one out... So we have a web app with the following URL structure:
/city/posttype/slug
We want to implement dynamic linking, but we only want to open certain post types in the app, nothing else.
So for example these should link to the app:
/new-york/posttypeA/slug
/new-york/posttypeB/slug
/new-york/posttypeC/slug
Meanwhile, for example, these should not be opened in the app:
/new-york/posttypeD/slug
/new-york
/
Here is our AASA file:
{
"applinks": {
"details": [
{
"appID": "OUR_APP_ID",
"paths": [
{
"/": "/*/posttypeA/*",
"comment": "matches all posttypeA"
},
{
"/": "/*/posttypeB/*",
"comment": "matches all posttypeB"
},
{
"/": "/*/posttypeC/*",
"comment": "matches all posttypeC"
},
]
}
]
}
}
But our iOS app still wants to handle all links from our website. As I've read any time I do a change to our AASA file I need to reinstall the iOS app which I did but still no luck. Any ideas?

Related

The woocommerce cart always comes up empty in my gatsby graphql

Its my first question, hope I am doing it right. I am trying to make a gatsby frontend for my woocommerce and its all fine. Up untill now all my queries has worked just fine, but when I make a query to get the cart information, it always comes up empty on my localhost://8000/___graphql but in the wp graphiql i can see it just fine.
here is my gatsby-config I guess this is where the problem would be.
siteMetadata: {
title: "shopone",
},
plugins: [
{
resolve: `gatsby-source-wordpress`,
options: {
url:
process.env.WPGRAPHQL_URL ||
`https://wpurl/graphql`,
},
},
{
resolve: "gatsby-source-graphql",
options: {
typeName: "WPGraphQL",
fieldName: "wpcontent",
url: "https://wpurl/graphql",
},
},
{
resolve: 'gatsby-wpgraphql-inline-images',
options: {
wordPressUrl: 'https://my/wpurl/',
uploadsUrl: 'https://my/url/wp-content/uploads/',
processPostTypes: ['Page', 'Post', 'CustomPost'],
graphqlTypeName: 'WPGraphQL',
httpHeaders: {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
}
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: (__dirname, `src`),
},
},
`gatsby-plugin-sass`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`
],
};
This is because your localhost:8000/___graphql is generated on the build-time, at this point, the cart will be always empty since the user has not been allowed to fill it yet.
Your WP GraphiQL API is an asynchronous API that gets the data in real-time, on-demand as the user fills the cart so it will always contain the as soon as the requests are done. To "connect" both, you will need to perform some fetch/post request to your API.
You can read for further information in Build Time and Client Runtime Data Fetching.

The LinkedIn Assets API don't show my upload in the linkedin newfeed

I'm using LinkedIn API to upload media to my Linkedin personal profile. I start with registring my image and I get a successful response.
REQUEST
{
"registerUploadRequest":{
"owner":"urn:li:person:xxx",
"recipes":[
"urn:li:digitalmediaRecipe:feedshare-image"
],
"serviceRelationships":[
{
"identifier":"urn:li:userGeneratedContent",
"relationshipType":"OWNER"
}
],
"supportedUploadMechanism":[
"SYNCHRONOUS_UPLOAD"
]
}
}
RESPONSE
{
"value": {
"uploadMechanism": {
"com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest": {
"headers": {
"media-type-family": "STILLIMAGE"
},
"uploadUrl": "xxxx"
}
},
"mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:xxx,urn:li:digitalmediaMediaArtifactClass:feedshare-uploadedImage)",
"asset": "urn:li:digitalmediaAsset:xxx"
}
}
Next step I uploaded my image using curl with a valid access token and the uploadUrl
I get a 201 HTTP response but I see nothing in my LinkedIn profile.
also when I check the status of my upload it shows me a success message.
{"recipes":[{"recipe":"urn:li:digitalmediaRecipe:feedshare-image","status":"AVAILABLE"}],"serviceRelationships":[{"relationshipType":"OWNER","identifier":"urn:li:userGeneratedContent"}],"mediaTypeFamily":"STILLIMAGE","created":1606729082880,"id":"C4D22AQE6h5xe3HYYiQ","lastModified":1606729322981,"status":"ALLOWED"}
So why I can't see my upload in the Linkedin timeline, please? I tried with both image and video but nothing is shown in my newsfeed.
Also, I checked my access token and it contains necessary permission: r_liteprofile, w_member_social
Uploading an asset does not make it available on your profile.
Assets API only uploads the image/video and stores it on LinkedIn platform. You can however use this asset to create a UGC Post to see it on your personal/company profile.
To do that, you'll have to use the ugcPosts API. ie call POST https://api.linkedin.com/v2/ugcPosts with
"media": "urn:li:digitalmediaAsset:XXX", from the Assets API response in the payload.
Example:
{
"author": "urn:li:organization:5590506",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"media": [
{
"media": "urn:li:digitalmediaAsset:XXX", // from the Assets API response
"status": "READY",
"title": {
"attributes": [],
"text": "Sample Video Create"
}
}
],
"shareCommentary": {
"attributes": [],
"text": "Some share text"
},
"shareMediaCategory": "VIDEO"
}
},
"targetAudience": {
"targetedEntities": [
{
"locations": [
"urn:li:country:us",
"urn:li:country:gb"
],
"seniorities": [
"urn:li:seniority:3"
]
}
]
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
Reference: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/ugc-post-api#sample-request

What constitute/determines Zeit serverless functions count

I recently moved a Nextjs project to Zeit platform. Until I configured environment setup I could deploy with no issue. After the environment setup which is very minimal as
{
"version": 2,
"name": "<....>",
"alias": "<...>",
"routes": [
{
"src": "^/service-worker.js$",
"dest": "/_next/public/service-worker.js",
"headers": {
"cache-control": "public, max-age=43200, immutable",
"Service-Worker-Allowed": "/"
}
}
],
"builds": [{ "src": "package.json", "use": "#now/next" }],
"env": {
"SENTRY_DNS": "<...>",
"DEV_BASE_URL": "<...>",
"PROD_BASE_URL": "<...>",
"NODE_ENV": "<...>"
}
}
I get this error when I deploy
As seen in the stub configuration, I have no server API setup, so I am confused about what could cause the function count
I had this same issue just trying to deploy my app for the first time. I believe every /pages creates a serverless function. There's some info on it here: https://vercel.com/docs/v2/serverless-functions/introduction
I tried removing some of my pages to test the theory and was able to get ti deploying by cutting down to 12 pages.

Gatsby/Wordpress - .env credentials not working

I am working with the gatsby-source-wordpress plugin
If I hard code my API keys/secret into my Gatsby.config, everything works fine, but I want to add these as .env variables so that I can .gitignore for deployment, and this is where things are breaking.
At the root of my directory, I have a .env file which looks like this
CLIENT_SECRET=10987654321
CLIENT_ID=123456
USER=secret#secret.com
PASS=mypassword1
I'm then try to access these in gatsby.config, like this
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`
});
module.exports = {
siteMetadata: {
title: 'Gatsby Default Starter',
},
plugins: [
{
resolve: 'gatsby-source-wordpress',
options: {
baseUrl: 'myurl.com',
protocol: 'http',
hostingWPCOM: true,
useACF: false,
auth: {
wpcom_app_clientSecret: `${process.env.CLIENT_SECRET}`,
wpcom_app_clientId: `${process.env.CLIENT_ID}`,
wpcom_user: `${process.env.USER}`,
wpcom_pass: `${process.env.PASS}`,
},
},
},
{
resolve: `gatsby-plugin-emotion`,
},
'gatsby-plugin-react-helmet',
{
resolve: `gatsby-plugin-manifest`,
options: {
name: 'gatsby-starter-default',
short_name: 'starter',
start_url: '/',
background_color: '#663399',
theme_color: '#663399',
display: 'minimal-ui',
icon: 'src/images/gatsby-icon.png', // This path is
relative to the root of the site.
},
},
'gatsby-plugin-offline',
],
}
which is returning the following errors when I run either gatsby develop or gatsby build
source and transform nodesThe server response was "400 Bad Request"
source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "User cannot access this private blog."
No routes to fetch. Ending.
So, the issue is the .env variables don't seem to be pulling through properly, but I can't see a reason why they wouldn't be? Is there anything I've missed in setting this up?
Gatsby doesn't know which plugin you mean (see How to use) and your overall syntax is wrong. The plugins is an array for example.
module.exports = {
plugins: [
{
resolve: "gatsby-source-wordpress",
options: {
auth: {
wpcom_app_clientSecret: process.env.CLIENT_SECRET,
wpcom_app_clientId: process.env.CLIENT_ID,
wpcom_user: process.env.USER,
wpcom_pass: process.env.PASS,
}
}
}
]
}
This should work assuming that you also define the other necessary fields mentioned in the README.

Single page polymer app tries to register elements multiple times when deployed to Firebase

I am using the Polymer starter kit as a reference for routing in a single page app. If I run the app on Cloud9 (the dev environment I am using) everything works as expected.
I run polymer build using the polymer-cli and then firebase deploy. The same app that runs with no issues on the Cloud9 instance produces multiple errors on Firebase Hosting.
Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'my-view1'. A type with that name is already registered.
The links are navigating as expected, but the console ends up loaded with errors like the one above. I'm guessing it has to do with the redirect to index.html in firebase.json.
firebase.json:
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "build/bundled",
"rewrites": [
{
"source": "**/!{*.*}",
"destination": "/index.html"
}
]
}
}
polymer.json:
{
"entrypoint": "index.html",
"shell": "src/my-app.html",
"fragments": [
"src/my-app.html",
"src/my-view1.html",
"src/my-view2.html",
"src/my-view3.html"
],
"sources": [
"src/**/*",
"images/**/*",
"bower.json"
],
"includeDependencies": [
"manifest.json",
"bower_components/webcomponentsjs/webcomponents-lite.min.js"
]
}
EDIT: Here is the routing section of the starter kit
<script>
Polymer({
is: 'my-app',
properties: {
page: {
type: String,
reflectToAttribute: true,
observer: '_pageChanged'
}
},
observers: [
'_routePageChanged(routeData.page)'
],
_routePageChanged: function(page) {
this.page = page || 'view1';
},
_pageChanged: function(page) {
// Load page import on demand. Show 404 page if fails
var resolvedPageUrl = this.resolveUrl('my-' + page + '.html');
this.importHref(resolvedPageUrl, null, this._showPage404, true);
},
_showPage404: function() {
this.page = 'view404';
}
});
</script>
There is an importHref call in there, is there a better way to handle the routing here?
Any tips, tricks, or words of wisdom are greatly appreciated.
Did you use importHref? Your my-view1 has been registered multiple times. Check again to ensure that my-view1 is not being registered more than once somewhere in your code.

Resources