Skip to content

Commit 17c3d98

Browse files
committed
version 1.59 context for refresh notification
1 parent 5dfb5b8 commit 17c3d98

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

docs/website/src/pages/AdvancedMethodsPage.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ interface IAdvancedMethodsPage {
1515
channel_management_code: string;
1616
getting_identifier_code: string;
1717
}
18+
19+
function isLegacyVersion(version: number) {
20+
return version <= 1.58;
21+
}
22+
1823
export default function AdvancedMethodsPage({ version }: { version: Iversion }) {
1924
const [data, setData] = useState<IAdvancedMethodsPage>()
2025

@@ -48,7 +53,19 @@ export default function AdvancedMethodsPage({ version }: { version: Iversion })
4853
<h2 className=" long-title">For Images:</h2>
4954
<hr />
5055
{/* <p tabIndex={0} className="paragraph">For Images:</p> */}
51-
<p className="paragraph">To add image after sending set <span className="code">already_sent</span> in <span className="code">addNotificationStyle</span> method to <span className="code">true</span></p>
56+
<p className="paragraph">To add image after sending
57+
{isLegacyVersion(version) ?
58+
<>
59+
<span> set </span>
60+
<span className="code">already_sent</span> in <span className="code">addNotificationStyle</span> method to <span className="code">true</span>
61+
</>
62+
:
63+
<>
64+
<span> use </span>
65+
<span className="code">setLargeIcon</span> or <span className="code">setBigPicture</span> then <span className="code">.refresh</span>
66+
</>
67+
}
68+
</p>
5269
<CodeBlock title="Image" code={data?.adding_image_code || ''} />
5370
</section>
5471

@@ -69,10 +86,10 @@ export default function AdvancedMethodsPage({ version }: { version: Iversion })
6986
<section id="getting-identifer" className="page-section" tabIndex={0}>
7087
<h2 className="long-title">Getting Identifer</h2>
7188
<hr />
72-
<p>If you want to get the Exact Notification Clicked to Open App, you can use NotificationHandler to get unique identifer (str) <span className="code">NotificationHandler{version <= 1.58?".getIdentifer":'.get_name'}</span></p>
89+
<p>If you want to get the Exact Notification Clicked to Open App, you can use NotificationHandler to get unique identifer (str) <span className="code">NotificationHandler{isLegacyVersion(version) ? ".getIdentifer" : '.get_name'}</span></p>
7390

7491
<p>
75-
{Boolean(version <= 1.58) && <span className="code warning yellow paragraph block width-max-con">In next version identifer will be changed to `name` and NotificationHandler.getIdentifer to NotificationHandler.get_name</span>}
92+
{isLegacyVersion(version) && <span className="code warning yellow paragraph block width-max-con">In next version identifer will be changed to `name` and NotificationHandler.getIdentifer to NotificationHandler.get_name</span>}
7693
</p>
7794
<CodeBlock title="Identifer" code={data?.getting_identifier_code || ''} />
7895
</section>

0 commit comments

Comments
 (0)