Skip to content

What is the API key supposed to be? No errors are logged. #36

Description

@ollyde
let env = env_vars();

let client = fcm::Client::new();

let mut map = HashMap::new();
map.insert("title", title);
map.insert("body", body);

if let Some(link) = deeplink {
    map.insert("link", link);
}

let mut builder = fcm::MessageBuilder::new(&env.google_cloud_private_key, token);

match builder.data(&map) {
    Ok(_) => println!("Data added to builder"),
    Err(e) => {
        println!("Failed to add data to builder: {:?}", e);
        return Err(e.into());
    }
}

let message = builder.finalize();

let response = client.send(message).await;
println!("Android Push Notification: {:?}", response);

Ok(())

I get

Android Push Notification: Err(ServerError(None))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions