Can't Understand Deep link and Intent - html

I want to use deep link to create a Online-Shop App. So Hear me out.
I know I have to use Intent and add <Intent-Filter><Intent-Filter/> tag in my AndroidManifest.xml file but I can't begin to understand how all of it works. There are few packages in pub.dev like flutter_branch_sdk: ^3.4.0 or receive_sharing_intent: ^1.4.5 but I'm hoping for a complete explanation or some sort of guide here. I appreciate the time you spend reading this in advance.
Here we go:
I have a app that has a Payment page. when user clicks on the Pay Now Button, He is transferred to a Safe Payment Gateway and interacts with the page. so there are 2 possible scenarios
He Succeeds in Completing the task and pays for the CARGO.
At this point Browser must Return to my app and gives me a text/message such as success and the app displays the Payment_Successful_Page
He Fails in Completing the task and pays for the CARGO
At this point Browser must Return to my app and gives me a text/message such as failure and the app displays the Payment_Failed_Page
That said If you know how it works maybe you can answer the questions below. (I have gathered the code parts from few documents and guides)
What is the <actvity><actvity/> do and what does the code below configure?
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:launchMode="singleTask"
<intent-filter>
...etc categories
</intent-filter>
</activity>
what does the <action/> do? How should I use it in app?
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.INPUT_METHOD_CHANGED" />
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<intent-filter />
how can I work with <category/> and What does the code below says?
what is the tag I should use for my scenario here?
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
how can I work with <data/> and What does the code below says?
How to get that text/message I want from the browser?
How to configure my own website where "example.com" is?
What are scheme and host here and how should it be written? (with 'http://' or without)
<data android:scheme="myapp" android:host="example.com" />
<data android:scheme="https" />
<data android:mimeType="text/plain" />
<data android:mimeType="text/*" />
<data android:mimeType="video/*" />
<data android:mimeType="image/*" />
<data android:mimeType="*/*" />
<data android:scheme="http" android:host="flutterbooksample.com" />
<data android:scheme="https" />

Related

Returning a custom response code for for serving static html when using IIS ApplicationInitialization remapManagedRequestsTo feature?

I'm currently using the ApplicationInitialization feature of IIS to warm up my ASP.NET application. I've set the attribute remapManagedRequestsTo to "warmup.html".
<applicationInitialization remapManagedRequestsTo="warmup.html" skipManagedModules="true" doAppInitAfterRestart="true" >
<add initializationPage="/home" />
<add initializationPage="/about-us" />
</applicationInitialization>
It's working well but I would like to return a custom status code when the content for Warmup.html is returned to the browser. This is so that when I run some smoke tests after deployment I get to know when the warm up has finished.
I've tried using URL Rewrite to change the status code from 200 to 555 to serve up warmup.html and it does change the status code but doesn't serve the content in warmup.html
<rewrite>
<rules>
<rule name="Change warm up status code" stopProcessing="true">
<match url="warmup.html" />
<action type="CustomResponse" statusCode="555" subStatusCode="0"/>
</rule>
</rules>
</rewrite>
Is there a way I can do both the serving of warmup.html's content AND return a custom status code of 555?
Finally found my answer in a blog post written by Morten Bock
Turns out I have to remove the two attributes remapManagedRequestsTo and skipManagedModules (default value of false) which leaves us with
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/home" />
<add initializationPage="/about-us" />
</applicationInitialization>
Then let the URL Rewrite module take over but we want to rewrite the response code when the Application Initialization is making the request marked by the server variable APP_WARMING_UP containing a value of 1. When this condition is met we can create a custom response as the action and pop the statusCode attribute with 555.
<rewrite>
<rules>
<rule name="WarmUp" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{APP_WARMING_UP}" pattern="1" />
</conditions>
<action type="CustomResponse" statusCode="555" statusReason="Site is warming up" statusDescription="Try again shortly" />
</rule>
</rules>
</rewrite>
Then to catch the status 555 as a custom error and direct the user to the friendly warm up page warmup.html
<system.webServer>
<httpErrors errorMode="Custom">
<error statusCode="555" path="warmup.html" responseMode="File" />
</httpErrors>
</system.webServer>

Add tab to edit product page in magento 2

I'm developing extension for magento 2.0. I can not add add tab to edit product page in back end. I try to use event core_block_abstract_prepare_layout_after but I'm not success. Can you help me how to do that.
Thank
In order to add a new tab in the product admin page you need to add a new 'Block' in view -> adminhtml. The layout has to be named catalog_product_new.xml. This is the content of my file (from my personnal module).
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product_tabs">
<block class="Okalm\Igram\Block\Adminhtml\Product\Edit\Tab" name="product.test">
<arguments>
<argument name="label" xsi:type="string" translate="true">Test</argument>
<argument name="url" xsi:type="url" path="test/moderate/index">
<param name="_current">1</param>
</argument>
<argument name="class" xsi:type="string">ajax</argument>
<argument name="group_code" xsi:type="string">advanced</argument>
</arguments>
</block>
<action method="addTab">
<argument name="name" xsi:type="string">product-instagram</argument>
<argument name="block" xsi:type="string">product.test</argument>
</action>
</referenceBlock>

Android Wear companion activity gear does not show up in watch face

I wanted to provide a Companion Configuration Activity for my Android Wear watch face. I have already build the app that has all the configuration and can communicate directly with the watch face, but I can only launch it from the launcher as app, but the gear does not show up in the watch face section of Android Wear app! Can I allow user to configure the watch face via companion app and also via Google Android Wear app?
This is how I declare my activity in phone module:
<activity
android:name=".Main"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<data android:mimeType="image/*"></data>
</intent-filter>
</activity>
On the watch part, I added in:
<meta-data
android:name=
"com.google.android.wearable.watchface.companionConfigurationAction"
android:value=
"virtualgs.photowatch.Main" />
<meta-data
android:name=
"com.google.android.wearable.watchface.wearableConfigurationAction"
android:value=
"virtualgs.photowatch.Main" />
And the result is the same - no gear shown on the Android Wear app.
Try something like this:
Phone Manifest:
<intent-filter>
<action android:name="com.virtualgs.photowatch.MAIN_CONFIG" />
<category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Watch Manifest:
<meta-data
android:name="com.google.android.wearable.watchface.companionConfigurationAction"
android:value="com.virtualgs.photowatch.MAIN_CONFIG" />
I think the intent action in the phone manifest has to be the same as the meta-data value in the watch manifest to work.
I think this is the correct answer about XML file config:
<activity
android:name=".DigitalWatchFaceWearableConfigActivity"
android:label="#string/digital_config_name">
<intent-filter>
<action android:name=
"com.example.android.wearable.watchface.CONFIG_DIGITAL" />
<category android:name=
"com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
As well as having the activity defined in the phone module, you need to reference it in the wear module as part of the declaration of your watch face service like this:
<service
android:name=".MyWatchFaceService" ... />
<!-- companion configuration activity -->
<meta-data
android:name=
"com.google.android.wearable.watchface.companionConfigurationAction"
android:value=
"com.my.watchface.CompanionConfigurationActivity" />
<!-- wearable configuration activity -->
<meta-data
android:name=
"com.google.android.wearable.watchface.wearableConfigurationAction"
android:value=
"com.my.watchface.WearableConfigurationActivity" />
...
Replacing com.my.watchface.CompanionConfigurationActivity and com.my.watchface.WearableConfigurationActivity with the fully qualified names of the configuration activities in the wear and phone modules respectively.

How rewrite Mage_Catalog_Block_Product_Price for handle catalog_product_view?

How to rewrite Mage_Catalog_Block_Product_Price only for handle catalog_product_view? This block haven't specific name in Layout.
<catalog_product_view>
<reference name="???">
<block type="test/price" name="test.price />
</reference>
</catalog_product_view>
Since in magento the product type is defining the block that is used to render the price, it is a little bit tricky. Maybe this can work:
go to your favorite layout xml file and add this
<catalog_product_view>
<reference name="catalog_product_price_template">
<action method="addPriceBlockType"><type>simple</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
<action method="addPriceBlockType"><type>virtual</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
<action method="addPriceBlockType"><type>grouped</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
<action method="addPriceBlockType"><type>downloadable</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
<action method="addPriceBlockType"><type>configurable</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
<action method="addPriceBlockType"><type>bundle</type><block>yourmodule/bundle_catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
</reference>
</catalog_product_view>
iam not 100% sure that this will work but its maybe a start for you

Adding custom CSS to Magento Homepage

I'm trying to add a css file to my CMS homepage by going to CMS > Pages > Home > Design then updating the Layout XML however it keeps adding in /base to the url to show the following:
<reference name="head">
<action method="addJs">
<script>nivo-slider/jquery.nivo.slider.js</script>
</action>
<action method="addCss">
<script>../bootstrap/theme_name/css/nivo-slider.css
</script></action>
</reference>
which outputs the following in view source:
<link rel="stylesheet" type="text/css" href="/skin/frontend/base/default/bootstrap/theme_name/css/nivo-slider.css" media="all" />
I've tried ../ and adding in the absolute link however it just adds it after the /base/
Is there a way I can override the theme trying to add in /base/
Assuming theme_name is your active theme, try to replace <action method="addCss">...</action> with this node:
<action method="addItem"><type>skin_css</type><file>css/nivo-slider.css</file></action>
Base folder is loaded due to the magento fallback. It searchs last in base folder, that's why base is added.
try with below code
<?xml version="1.0">
<layout>
<default>
<reference name="head">
<action method="addItem"><type>skin_css</type><file>css/nivo-slider.css</file></action>
</reference>
</default>
</layout>
hope this will sure help you.