爱意满满的作品展示区。
iPocket

[送码] 维护了快一年的会员订阅管理工具 — 口袋订阅,最近大幅优化了一版本

  •  
  •   iPocket · 14h 36m ago · 1153 views
    一个苹果 iOS 原生制作的会员订阅管理工具 —— 口袋订阅,维护了快一年了,总体很稳定了,非常感谢国内外的朋友反馈,特别是一个老外叫 Jimmy ,好像非常喜欢我这款产品,他发现 bug 总是发邮件给我,邮件里有和他对话的几十封邮件了,真的非常感谢,也很开心。
    产品主打简约,可以快速添加会员订阅,快速查找会员订阅,其他功能,订阅 APP 里该有的应该都有。然后可以通过长按别的 APP 分享到 口袋订阅 快速添加,也可以通过搜索 APP/网站 名称来快速添加,其他功能我倒觉得没那么重要,主要看个大概的费用。
    APP 不搜集你的任何数据,这里其实有个缺点,就是你想改善你的产品的时候,没有数据,就会发现无从下手,你根本不知道用户在哪个页面体验不好😂,全靠用户从其他渠道反馈,邮件、小红书等。如有苹果开发者也可以一起交流下这方面的经验。
    App Store 地址: https://apps.apple.com/cn/app/%E5%8F%A3%E8%A2%8B%E8%AE%A2%E9%98%85-%E8%AE%A2%E9%98%85%E7%AE%A1%E7%90%86%E4%B8%8E%E8%B4%A6%E5%8D%95%E6%8F%90%E9%86%92/id6752631319


    留言抽 20 个永久会员,明天收市后按上证指数抽出,因为我发现我送的很多兑换码感觉被机器人秒了
    抽奖程序由 GPT 提供,代码如下
    ```javascript
    (async function lottery() {
    const drawTime = "2026-05-27 18:00:00"; // 开奖时间
    const postUrl = "https://example.com/post/123"; // 帖子链接
    const shIndex = "3123.45"; // 上证指数,建议用字符串,避免小数精度问题
    const replyTotal = 1000; // 回复总数
    const winnerCount = 20; // 抽奖个数

    if (!drawTime || !postUrl || !shIndex) {
    console.error("开奖时间、帖子链接、上证指数不能为空");
    return;
    }

    if (!Number.isSafeInteger(replyTotal) || replyTotal <= 0) {
    console.error("回复总数必须是大于 0 的安全整数");
    return;
    }

    if (!Number.isSafeInteger(winnerCount) || winnerCount <= 0) {
    console.error("抽奖个数必须是大于 0 的安全整数");
    return;
    }

    if (winnerCount > replyTotal) {
    console.error("抽奖个数不能大于回复总数");
    return;
    }

    async function sha256Hex(text) {
    const data = new TextEncoder().encode(text);
    const hashBuffer = await crypto.subtle.digest("SHA-256", data);

    return Array.from(new Uint8Array(hashBuffer))
    .map(b => b.toString(16).padStart(2, "0"))
    .join("");
    }

    function hexToBigInt(hex) {
    return BigInt("0x" + hex);
    }

    async function randomInt(seed, counter, maxExclusive) {
    const max = BigInt(maxExclusive);
    const space = 1n << 256n;
    const limit = space - (space % max);

    while (true) {
    const hash = await sha256Hex(seed + ":" + counter.value);
    counter.value++;

    const num = hexToBigInt(hash);

    // 拒绝采样,避免简单取模产生偏差
    if (num < limit) {
    return Number(num % max);
    }
    }
    }

    async function drawWinners(seed, replyTotal, winnerCount) {
    const winners = [];
    const swapped = new Map();
    const counter = { value: 0 };

    for (let i = 0; i < winnerCount; i++) {
    const remaining = replyTotal - i;
    const r = await randomInt(seed, counter, remaining);

    const selectedIndex = i + r;

    const selectedValue = swapped.has(selectedIndex)
    ? swapped.get(selectedIndex)
    : selectedIndex + 1;

    const currentValue = swapped.has(i)
    ? swapped.get(i)
    : i + 1;

    swapped.set(selectedIndex, currentValue);
    winners.push(selectedValue);
    }

    return winners;
    }

    const rawSeed = [
    `开奖时间=${drawTime}`,
    `帖子链接=${postUrl}`,
    `上证指数=${shIndex}`,
    `回复总数=${replyTotal}`,
    `抽奖个数=${winnerCount}`
    ].join("|");

    const seedHash = await sha256Hex(rawSeed);
    const winners = await drawWinners(seedHash, replyTotal, winnerCount);
    const sortedWinners = [...winners].sort((a, b) => a - b);

    console.log("========== 抽奖结果 ==========");
    console.log("原始种子:");
    console.log(rawSeed);
    console.log("");
    console.log("种子 SHA-256:");
    console.log(seedHash);
    console.log("");
    console.log("中奖楼层:");
    console.log(winners.join(", "));
    console.log("");
    console.log("中奖楼层,升序:");
    console.log(sortedWinners.join(", "));
    console.log("============================");
    })();
    ```
    55 replies    2026-05-27 11:37:42 +08:00
    TaoTao
        1
    TaoTao  
       12h 7m ago via iPhone
    支持下
    vpromise
        2
    vpromise  
       11h 55m ago
    前来支持
    xspoco
        3
    xspoco  
       11h 21m ago
    支持一下
    huoma
        4
    huoma  
       10h 38m ago via iPhone
    kk
    samli12
        5
    samli12  
       10h 34m ago
    支持
    Crazy9527
        6
    Crazy9527  
       9h 46m ago via Android
    支持
    azhezzz
        7
    azhezzz  
       9h 18m ago
    支持
    outofbound
        8
    outofbound  
       9h 4m ago
    支持!
    eocp2020
        9
    eocp2020  
       6h 34m ago
    支持下
    marcoseaver
        10
    marcoseaver  
       5h 40m ago
    支持下!
    believems
        11
    believems  
       4h 57m ago via iPhone
    支持
    wesky8201
        12
    wesky8201  
       4h 40m ago via iPhone
    支持支持
    imbelike
        13
    imbelike  
       4h 27m ago
    支持一下
    AceRacer
        14
    AceRacer  
       3h 56m ago via Android
    支持一下
    ChanYancy
        15
    ChanYancy  
       3h 47m ago
    支持支持
    song135711
        16
    song135711  
       3h 40m ago
    支持下
    whiteleopard520
        17
    whiteleopard520  
       3h 33m ago via iPhone
    厉害了,支持
    gegeburu
        18
    gegeburu  
       3h 25m ago via iPhone
    支持一下
    evilHa
        19
    evilHa  
       3h 16m ago
    支持一下
    s1eep
        20
    s1eep  
       3h 9m ago
    支持一下
    Fxshiny
        21
    Fxshiny  
       3h 9m ago
    NIUDE 看不懂=-=
    Lituby
        22
    Lituby  
       3h 5m ago via Android
    支持一下
    cymcc
        23
    cymcc  
       2h 57m ago
    支持支持
    wl62613
        24
    wl62613  
       2h 57m ago
    支持一下
    bizwenbo
        25
    bizwenbo  
       2h 54m ago
    支持
    yunmeng
        26
    yunmeng  
       2h 53m ago
    分母
    Lituby
        27
    Lituby  
       2h 44m ago
    支持
    ponng
        28
    ponng  
       2h 44m ago via iPhone
    分母一下
    eod
        29
    eod  
       2h 40m ago
    支持
    easymbol
        30
    easymbol  
       2h 38m ago
    支持一下,当个分母
    Shum1n
        31
    Shum1n  
       2h 26m ago
    众在参与
    ganzhen
        32
    ganzhen  
       2h 18m ago via iPhone
    参与一下
    sktline
        33
    sktline  
       2h 10m ago
    支持一下
    passtest
        34
    passtest  
       2h 7m ago
    支持一下
    Emyorii
        35
    Emyorii  
       1h 46m ago
    支持一下
    roma
        36
    roma  
       1h 43m ago
    +1024
    54xavier
        37
    54xavier  
       1h 36m ago
    我是自己写接口加维护数据 + 快捷指令 + bark 每日推送提醒,有点儿累了,如果中了试试这个 app 吧
    fengtalk
        38
    fengtalk  
       1h 31m ago
    祝楼主大卖!
    lc4t
        39
    lc4t  
       1h 28m ago
    支持一下
    kongzz
        40
    kongzz  
       1h 24m ago
    支持一下
    Jokerboozp
        41
    Jokerboozp  
       1h 23m ago
    支持一下
    aka404
        42
    aka404  
       1h 16m ago via Android
    支持一下
    windowlife
        43
    windowlife  
       1h 4m ago
    支持一下
    htd
        44
    htd  
       1h 3m ago
    支持支持
    abcde51111
        45
    abcde51111  
       1h 2m ago
    支持
    chocolatesir
        46
    chocolatesir  
       1h 1m ago
    支持一下
    LightChan
        47
    LightChan  
       53 mins ago
    支持
    lepig
        48
    lepig  
       52 mins ago
    实用的的小工具
    pljhonglu
        49
    pljhonglu  
       49 mins ago
    支持一下
    Rex180123
        50
    Rex180123  
       49 mins ago
    支持一下~
    stone9527
        51
    stone9527  
       44 mins ago
    支持 OP
    chiaoyuja
        52
    chiaoyuja  
       41 mins ago
    支持一下
    VincentElis1024
        53
    VincentElis1024  
       14 mins ago
    支持一下
    w797200
        54
    w797200  
       12 mins ago via Android
    支持一下
    Wyearn
        55
    Wyearn  
       8 mins ago
    支持一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5419 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 150ms · UTC 03:46 · PVG 11:46 · LAX 20:46 · JFK 23:46
    ♥ Do have faith in what you're doing.