Valyrian
V2EX  ›  iOS

iOS 有什么自动后台同步的办法吗

  •  
  •   Valyrian · Jul 19, 2017 · 4784 views
    This topic created in 3417 days ago, the information mentioned may be changed or developed.

    单向同步就可以,想要的实现的效果是每天晚上充电的时候自动下载家里 nas 上的某个文件夹。协议可以是 smb,ftp。

    app 的后台就十分钟,而且没法自动启动,有没有什么别的办法? iOS 企业功能能不能实现?

    10 replies  •  2017-07-20 02:22:37 +08:00
    Cavolo
    Cavolo
    Jul 19, 2017 via iPhone
    1
    后台放歌
    QAPTEAWH
    QAPTEAWH
    Jul 19, 2017
    2
    iOS/Android 双持大法好
    operafans
    operafans
    Jul 19, 2017
    3
    app 不支持后台自动刷新?

    放歌 呵呵 咋不说后台开着定位呢 逗
    that
    that
    Jul 19, 2017
    4
    Background Transfer Service
    chmlai
    chmlai
    Jul 19, 2017
    5
    background fetch
    daiqiangbudainiu
    daiqiangbudainiu
    Jul 19, 2017
    6
    开启后台就行了,手机上设置得打开
    weilian
    weilian
    Jul 19, 2017
    7
    弄个定时通知?后台唤醒 App 来进行下载
    Artail
    Artail
    Jul 19, 2017
    8
    后台应用刷新。
    ningcool
    ningcool
    Jul 19, 2017
    9
    我有一个办法:
    要求:同步的文件不能太大。
    方案:
    1: 利用 IOS 10 以上的 notification extend 捕获 APNS 通知,这个时候该应用的通知就会被 extend target 捕捉,你只需要在捕捉通知的地方 下载小文件即可。

    //捕获
    - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler { }
    //下载后的回调
    - (void)loadAttachmentForUrlString:(NSString *)urlStr withType:(NSString *)type completionHandle:(void(^)(UNNotificationAttachment *attach))completionHandler
    {

    }

    2: extend target 下载的小文件 可以 和你 主 target (也就是你的 app )共享的,通过 ApplicationGroup 可以实现多个 target 数据互通。

    NSURL *containerURL = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"XXXXXX"];
    danielzhang0212
    danielzhang0212
    Jul 20, 2017
    10
    Resilio Sync 设置一个同步文件夹。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   928 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 21:14 · PVG 05:14 · LAX 13:14 · JFK 16:14
    ♥ Do have faith in what you're doing.