Skip to content

Execute account binding interface ​

effect ​

If you need to open an activity in the game and bind a certain account, you can call this interface.


Function ​

objective-c
- (void)gamedreamerBindWithSuperView:(UIView * _Nullable)superView withBindTypes:(NSArray<bind_type> *)bindTypes withCompletion:(void(^ _Nullable)(action_type action, NSDictionary *result))completion;

Correction ​

參數名Nullable (Yes/No)explain
superViewYesIs the parent view to which the store view is added. By default, superview is passed to nil.
bindTypesNoDisplays account binding types. There are currently 8 options: 1. bindall (display all binding types) 2. bindphone (bind phone number) 3. bindemail (bind email) 4. bindfb (bind Facebook) 5. bindtwitter (bind Twitter) 6. bindline (bind Line) 7. bindgoogle (bind Google) 8. bindapple (bind Apple)
completionYesThe binding result is returned, but when the binding fails, the SDK will not return it, because the SDK has already made a pop-up prompt and the game no longer needs to prompt. action has two events, namely: 1. When actionclose, result is empty, and this action means to close the binding interface;2. When actionbind occurs, the result is non-empty. The data format is as follows: @{@ "action": @ "bind",@ "bindType": @ "email",@ "status": @ "success"}, where bindType is the binding type,The bind_type type can be used for comparison. status has two statuses, namely success and already, which means "binding succeeded" and "bound"

Example code ​

objective-c
[[GamedreamerManager shareInstance] gamedreamerBindWithSuperView:nil withBindTypes:@[bind_fb,bind_line] withCompletion:^(action_type action, NSDictionary *result) {
        if(action == action_close){
            NSLog(@"關閉界面");
        } else if(action == action_bind) {
            NSLog(@"綁定結果->%@",result.description);
        }
    }
];