Deep linking issue when the app is open in background react native - react-native

I am facing an issue related to deep linking in react native. Deep linking is implemented for both ios and android. I am using deep linking to confirm user's account. User click on confirm my account on email sent to him which should ideally redirect him back to the application. Upon clicking the confirmation link, it does redirect it to the app.
If the app is closed, everything works fine and the user gets confirmed. But the issue is that if the app is already open, upon redirecting, it does not confirm the user.
This is my code that I have written in main entry file (App.js)
useEffect(() => {
Linking.getInitialURL().then(url => {
if (url == null) {
return;
} else {
handleDeepLink(url);
}
});
let subcribtion = Linking.addEventListener('url', handleDeepLink);
subcribtion.subscriber;
return () => {
subcribtion.remove();
};
}, []);
Here is my implementation in AndroidManifest.xml
<intent-filter >
<data android:scheme="com.sensights" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter >
<intent-filter android:autoVerify="true" android:label="stage01.random.ai">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="stage01.random.ai"
android:pathPrefix="/"
/>
<data android:scheme="https" android:host="stage01.random.ai"
android:pathPrefix="/"
/>
</intent-filter>
I also tried using App State from react native. But the issue with it is when comes on the foreground, Linking.getInitialURL() returns null.
My react native version is 0.70.5, react-navigation version is 4.4.4 and I am using universal links as deep linking approach.
Any help would be appreciated. Thanks in advance.
I was trying to confirm user account via deep linking but was unable to confirm user when the app was in background

Related

How customize EditCustomfieldDefaults screen in my customfield plugin

I'm trying to override the default customfield value setting screen, but I'm unable to add the template.
The standard edit.vm template allows you to change the value of the field in the issue, but I need a separate page for this
enter image description here
My code from atlassian-plugin.xml
`
<customfield-type
name="Metro Cascading Custom Field"
i18n-name-key="metro-cascading-custom-field.name"
key="metro-cascading-custom-field"
class="MetroCascadingCustomField.MetroCascadingCustomField">
<description
key="metro-cascading-custom-field.description">The Metro Cascading Custom Field Plugin</description>
<resource name="view" type="velocity" location="/templates/customfields/metro-cascading-custom-field/view.vm"/>
<resource name="edit" type="velocity" location="/templates/customfields/metro-cascading-custom-field/edit.vm"/>
</customfield-type>
<webwork1
key="metro-cascading-cuastomfield-webwork"
name="Metro Cascading Cuastomfield Webwork"
i18n-name-key="metro-cascading-cuastomfield-webwork.name">
<description key="metro-cascading-cuastomfield-webwork.description">The Metro Cascading Cuastomfield Webwork Plugin</description>
<actions>
<action name="ru.jira.metro.plugin.jira.webwork.MetroCascadingCuastomfieldWebworkAction" alias="CustomMultiSelectOptionsConfiguration">>
<view name="success">/templates/metro-cascading-cuastomfield-webwork/success.vm</view>
<view name="input">/templates/metro-cascading-cuastomfield-webwork/input.vm</view>
<view name="error">/templates/metro-cascading-cuastomfield-webwork/error.vm</view>
</action>
</actions>
<context>atl.admin.custom-fields</context>
</webwork1>
`

Routing from outside of a Route component

I have an app where i'm using react router and I can't figure out how to change the route in this use case. Here's how my code is structured:
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
<Router>
<Panels />
<Route path="/view" render={()=> <MyComponent />} />
<Route path="/about" render={()=> <MyOtherComponent />} />
</Router>
Inside <Panels> are some tabs I have that I would like to change the route.
<Tabs defaultActiveKey="1" onChange={}>
<TabPane tab="Tab 1" key="1" >
<Somecomponent />
</TabPane>
<TabPane tab="Tab 2" key="2">
Test me
</TabPane>
</Tabs>
These are antd tabs so they don't have a clickable component that I can put a <Link> into, and <Panels> is outside of a <Route> so I'm not sure if I'm able to access history object otherwise. I could put the panels in each <Route> but that would be really bad.
What way should I go about this?
Figured this one out finally.
import { withRouter } from 'react-router-dom'
...
<Tabs defaultActiveKey="1" onChange={(key)=> this.props.history.push(`/${key}`)}>
<TabPane tab="Tab 1" key="1" >
<Somecomponent />
</TabPane>
<TabPane tab="Tab 2" key="2">
Test me
</TabPane>
</Tabs>
...
export default withRouter(Panels);
wrapping the export with withRouter give the component access to the history object to push and read routes. I saw this solution initially but couldn't get it to work. Turns out it was because I was importing withRouter from react-router and not react-router-dom, so I was loading in the wrong history.

change default icon outlook-addin

I try to change the defaut icon of y outlook add-in. By defaut it's blue icon
I changed every logo in my images folder. When I would like add my add-in I see the correct logo
But on Outlook, I have again the old logo []
3
I tried to clean and rebuild the solution, but it didn't change anything. I don't understand why I have always the old logo. I don't know where this old logo come from
Try to add in your manifest file this:
<IconUrl DefaultValue="your URL to image"/>
<HighResolutionIconUrl DefaultValue="your URL to image" />
The image have to be 128x128 .
If you have compose and read tags you need also have this:
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
When icon16,icon32,icon80 is inside the source tag:
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="your URL to image"/>
</bt:Images>
</Resources>
You can see full example and explanation here:
https://learn.microsoft.com/en-us/outlook/add-ins/manifests

Laying out components and managing state with animation stagger using React Native?

Im trying to solve a problem with managing state in my react native application. the effect Im trying to build is that the current items on screen stagger out of the screen while asynchronously bringing in the new items from offscreen when changing state, this is best represented with gif.
So basically when I change the the state for the active answerContainer, it should stagger the previous items out of the screen, while bringing the new items in.
Code(Pseudo):
this.state = {
activeAnswerContainer: 1
}
...
<AnswerContainer active={this.state.activeAnswerContainer === 1} ...
<Answer />
<Answer />
<Answer />
<Answer />
<AnswerContainer active={this.state.activeAnswerContainer === 2} ...
<Answer />
<Answer />
<Answer />
<Answer />
This is not an animation issue, as I already have the desired effect i need, my problem is dealing with the state, and how can I get the answerContainers to communicate with each other.

How can I show a message after uninstalling a WiX Burn bundle?

How can I add a message to the successfully uninstalled page of a Burn bundle?
I am using HyperlinkSidebarLicense of the WiX standard bootstrapper application and use a copy of the default theme (at src\ext\BalExtension\wixstdba\Resources\HyperlinkSidebarTheme.xml):
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkSidebarLicense">
<bal:WixStandardBootstrapperApplication
LicenseUrl=""
ThemeFile="Theme.xml"
LocalizationFile="Theme.wxl" />
</BootstrapperApplicationRef>
I then modified the Success page by adding a Text:
<Page Name="Success">
...
<Text Name="SuccessUninstallMessage" X="185" Y="110" Width="-11" Height="40"
FontId="3" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessMessage)</Text>
...
</Page>
However the modified Success page is also shown during installation (in addition to uninstall), which I don't want.
How can I show a message only during uninstall on the Success page?
That's not supported in WixStdBA in WiX v3.x. WixStdBA has code to show different messages based on the action and it only does that for the header text (SuccessHeader, SuccessInstallHeader, SuccessRepairHeader, and SuccessUninstallHeader).
In WiX v4.0 (not yet in beta), themes can conditionally control the text shown without requiring supporting code in WixStdBA:
<Label X="0" Y="250" Width="-0" Height="20" FontId="1" Center="yes">
<Text Condition="WixBundleAction = 5">#(loc.SuccessInstallMessage)</Text>
<Text Condition="WixBundleAction = 6">#(loc.SuccessInstallMessage)</Text>
<Text Condition="WixBundleAction = 7">#(loc.SuccessRepairMessage)</Text>
<Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallMessage)</Text>
</Label>