Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switchInlineQuery can't work on ios, Android is normal. #29

Open
elsemk opened this issue Nov 13, 2024 · 1 comment
Open

switchInlineQuery can't work on ios, Android is normal. #29

elsemk opened this issue Nov 13, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@elsemk
Copy link

elsemk commented Nov 13, 2024

"@twa-dev/sdk": "^7.10.1"
ios 17
mywebapp:https://t.me/testElse_bot/whatTelegram
After registering, go to the lucky draw page and click Invite for Spins,No response at ios。
`import React, { memo } from 'react';
import { RightOutline } from 'antd-mobile-icons';
import WebApp from '@twa-dev/sdk';
import { useMemoizedFn, useRequest } from 'ahooks';
import { useNavigate } from 'umi';

import InvitationBg from '@/assets/game-invite-bg.png';
import ShareLinkIcon from '@/assets/share-link-icon.png';
import ShareCopyIcon from '@/assets/share-copy-icon.png';
import DownloadIcon from '@/assets/invite-download-icon.png';
import InviteBtnBg from '@/assets/invite-btn-bg.png';
import useTelegramInfo from '@/models/useTelegramInfo';
import { copyText } from '@/utils/tools';
import useUserInfo from '@/models/useUserInfo';
import api from '@/services';

import './index.less';

export default memo(() => {
const { userInfo } = useUserInfo();
const tmaInfo = useTelegramInfo();

const navigate = useNavigate();

const { data } = useRequest(() => {
return api.common.getInviteList({ current: 1, size: 10 });
});

const handleInvite = useMemoizedFn(() => {
if (tmaInfo?.initDataUnsafe?.user?.id) {
// @ts-ignore
WebApp.switchInlineQuery(tmaInfo.initDataUnsafe.user.id, [
'users',
'groups',
'channels',
'bots',
]);
}
});

const handleCopy = useMemoizedFn(() => {
copyText(https://t.me/testElse_bot/whatTelegram?startapp=${userInfo?.id});
});

const handleDownload = useMemoizedFn(() => {
WebApp.openLink(
https://www.iboloup.com/home?shareID=${userInfo?.id}&telegram_id=${tmaInfo?.initDataUnsafe?.user?.id},
);
});
return (








Invite for Spins





<div className="c-mi__user" onClick={() => navigate('/invitation')}>

Invited users : {data?.total || 0}








DownloadAPP for 1 free Spins



);
});
`

@ArthurStam
Copy link
Member

Please provide more information about behavior on iOS: actual and your expectations.

@ArthurStam ArthurStam added help wanted Extra attention is needed TG Issue Issue that is related rather to Telegram than to this library and removed TG Issue Issue that is related rather to Telegram than to this library labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

2 participants