I am using this DDP package to login from my iOS app:
https://github.com/martijnwalraven/meteor-ios/
But I can only find a method called loginWithEmail.
How can I edit this so I can login with the username?
You have to make the method yourself.
Find METDDPClient+AccountsPassword.h and .m
In .h you
- (void)loginWithUsername:(NSString *)username password:(NSString *)password completionHandler:(nullable METLogInCompletionHandler)completionHandler;
And then in .m
- (void)loginWithUsername:(NSString *)username password:(NSString *)password completionHandler:(METLogInCompletionHandler)completionHandler{
[self loginWithMethodName:@"login" parameters:@[@{@"user": @{@"username": username}, @"password": @{@"digest": [password SHA256String], @"algorithm": @"sha-256"}}] completionHandler:completionHandler];
}