roundware / roundware-ios-framework-v2

Roundware framework, updated for api v2 and re-built in Swift (as much as possible)
MIT License
1 stars 8 forks source link

Add content blocking API call with demo #9

Closed seeReadCode closed 5 years ago

seeReadCode commented 7 years ago

something like...

        let assetID = String(currentAsset.assetID)
        let rwf = RWFramework.sharedInstance

        let moreModal = UIAlertController(title: "More actions", message: "", preferredStyle: UIAlertControllerStyle.alert)

        //Block Recording
        //TODO mark completed
        moreModal.addAction(UIAlertAction(title: "Block Recording", style: UIAlertActionStyle.default, handler: {(alert: UIAlertAction!) in
            rwf.apiPostAssetsIdVotes(asset_id: assetID, vote_type: "block_recording",
                success: { (data) -> Void in
                }, failure:  { (error) -> Void in
            })
        }))

        //Block User
        moreModal.addAction(UIAlertAction(title: "Block User", style: UIAlertActionStyle.default, handler: {(alert: UIAlertAction!) in
                rwf.apiPostAssetsIdVotes(asset_id: assetID, vote_type: "block_user",
                    success: { (data) -> Void in
                    }, failure:  { (error) -> Void in
                })
        }))

        //Flag Recording
        moreModal.addAction(UIAlertAction(title: "Flag Recording", style: UIAlertActionStyle.default, handler: {(alert: UIAlertAction!) in
            rwf.apiPostAssetsIdVotes(asset_id: assetID, vote_type: "flag",
                success: { (data) -> Void in
                }, failure:  { (error) -> Void in
            })
        }))

        //Cancel
        moreModal.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler: nil))
        self.present(moreModal, animated: true, completion: nil)
seeReadCode commented 7 years ago

editing this re: https://github.com/seeRead/roundware-ios-digita11y/issues/25 because functionality is covered by the vote method.


deprecated Server endpoint is in progress...

Format will be: POST /api/2/blockedcontent/ - with params: